Ad
  • Custom User Avatar

    About the edit, you're right, the value should be inserted at the end, and that's why it fails.

  • Custom User Avatar

    Your code being wrong is not a kata issue, see the sample test it fails and you'll see why it fails. The value to insert is not always already contained in the array that's why your code returns -1. About your second solution, it now fails 100% of the time.