1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| long[] array = new long[] {1,5,10,50,100,500,1000,5000,10000,50000}; assertEquals(6, test.solution(10, 4200, array)); assertEquals(12, test.solution(10, 4790, array)); assertEquals(1, test.solution(10, 50000, array)); assertEquals(2000, test.solution(10, 100000000, array));
array = new long[] {1}; assertEquals(2, test.solution(1, 2, array)); assertEquals(1, test.solution(1, 1, array)); assertEquals(100000000, test.solution(1, 100000000, array));
array = new long[] {1, 5}; assertEquals(1, test.solution(2, 5, array));
array = new long[] {1, 3}; assertEquals(2, test.solution(2, 4, array));
array = new long[] {1, 100}; assertEquals(1, test.solution(2, 100, array));
array = new long[] {5000}; assertEquals(1, test.solution(1, 5000, array));
|