Ad
  • Custom User Avatar

    By 'The first item' test, I assume you mean, cases where the test is like this arr = [1, 2, 2, 2]. It's not passing because you initially assign 0 to n (totally fine), but then later, you're reassigning n to be arr[1], since arr[1] is not in non_unique at this point (at this point, non_unique only has arr[0]). Since you are adding items to an array and comparing, try adding the 2nd item into your non_unique array, then go from there. If you do add the 2nd item though, be careful to start your loop at the 3rd index of the array, and then compare. Not sure if that's giving away too much.

  • Custom User Avatar