# SCJP经典试题

public class TheLuckyNumbersLevelOne{

public long find(long a, long b){

}

}

1<=a<=10^18

1<=b<=10^18

0)

1

100

Returns: 4

1)

45

54

Returns: 0

2)

477444774

477444774

Returns: 1

3)

456789123

789123456

Returns: 24

public class TheLuckyNumbersLevelTwo{

public int[] find(int[] numbers){}

}

1 <= numbers[i] <= 1,000,000,000,其中 1<=i<=34.

:

0)

{1, 2, 3, 4}

Returns: {1, 2, 4 }

7有两个子集{3, 4} 和 {1, 2, 4}. 选择字典排序小的{1,2,4}

1)

{12, 43, 29}

Returns: { }

2)

{4, 7}

Returns: {7 }

3)

{41, 2, 28, 44, 7, 42, 21}

Returns: {7, 28, 42 }

4)

{15, 10, 28, 3, 13, 27, 7}

Returns: {7, 15, 27, 28 }

5)

{18, 45, 6}

Returns: { }

6)

{34, 20, 26, 28, 33, 23, 44, 40, 25, 10, 36, 14, 7, 29, 21, 27, 17, 13, 19, 24, 32, 41, 31}

Returns: {7, 10, 13, 14, 17, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 31, 32, 34, 44 }

public class TheLuckyNumbersLevelThree{

public int[] find(int[] numbers){}

}

1<=a<=10^16

1<=b<=10^16

0)

1

10

Returns: {0, 0, 0, 0, 1, 0, 0, 1, 1, 0 }

1)

78

79

Returns: {0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }

2)

1

47

Returns: {2, 4, 7, 3, 7, 1, 2, 1, 2, 0 }

3)

21

91

Returns: {4, 2, 7, 4, 9, 3, 7, 5, 7, 2 }

• 本文已收录于以下专栏：

举报原因： 您举报文章：SCJP经典试题 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)