Ad
  • Custom User Avatar

    I know I'm 2 years late, but his code is about ~3 faster. Tested it with 1 and 10 million executions.

  • Custom User Avatar

    Approved by Johan

  • Custom User Avatar

    you are mutating the input array, this is why the assertion messages are confusing. i patched the tests so that the message is computed before the function call. your code is incorrect though, you need to fix it. also note that mutating your input when you are not asked to is bad practice, and in this kata in particular it cannot work as sometimes you will need to add an element.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution