Ad
  • Default User Avatar

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

  • Default User Avatar

    This solution eats the last number at the end of the sorted array and instead repeats the first element after the sorted array.

  • Default User Avatar

    Current PHP solution is wrong, which means the tests are also giving out false failures.
    Test array:
    array(7, 18, 7, 5, 14, 16, 15, 1, 9, 15, 0, 16, 10, 13, 2, 5, 10, 3, 5, 6)
    __sol return array:
    array(7, 0, 1, 5, 7, 9, 14, 15, 15, 16, 16, 16, 10, 13, 2, 5, 10, 3, 5, 6)

    If you compare the two arrays then you will notice that the number 18 is completely missing from the returned array, instead 16 is repeated twice.
    This makes it impossible to solve this kata with a correct PHP solution.