Ad
  • Custom User Avatar

    That means the sorted hand according to your sorting comparator differs at that spot.

    It's far from useful feedback I know.

  • Default User Avatar

    I agree with you. I see lots of accepted solutions to be wrong, but thankfully i've done it the right way. :)

  • Custom User Avatar

    Unfortunatelly, test cases for python and javascript is locked. I add this case to other languages and to example test cases in js and python. Thanks for report!

  • Custom User Avatar

    Why? I think you are misunderstanding the Kata. You need to find the number that occurs an odd amount of times, not the maximum amount of times.

    array = [1, 1, 2, -2, 5, 2, 4, 4, -1, -2, 5]
    
    Number of occurences = {1: 2, 2: 2, 4: 2, 5: 2, -1: 1, -2: 2}
    
    -1 has an **odd** number of occurences of 1, whilst the rest have even occurences; therefore you should return -1.