codility icon indicating copy to clipboard operation
codility copied to clipboard

programming lessons on codility

Results 5 codility issues
Sort by recently updated
recently updated
newest added

make solution like this // write your code in Java SE 8 HashSet dups = new HashSet(); for (int i = 0; i < A.length; i++) { if (!dups.add(A[i])) {...

If the main has the following code `System.out.println(solution(new int[] { 7, 9, 3, 9, 3, 9, 9 }));` an incorrect number is returned by solution2. The below code for solution2...

I believe if we get an array full of all possible integers the return of 'min' (which is 1) is not quite correct. I decided to return Integer.MAX_VALUE in this...

When I check the second solution on official codility website Found some of "Wrong answer" But unfortunately, they not support us with failed test cases data https://github.com/karimhamdanali/codility/blob/6ddaf5e714feb48b051838379d7a659775450e19/src/codility/OddOccurrencesInArray.java#L36 ![image](https://user-images.githubusercontent.com/6502770/52688099-e9aad480-2f65-11e9-8133-81149a63b157.png)

Came upon this code through google search https://github.com/karimhamdanali/codility/blob/6ddaf5e714feb48b051838379d7a659775450e19/src/codility/OddOccurrencesInArray.java#L41-L46 If the input array is arranged so that the odd number occurs before the pairs, the output will be the last number...