Ad
  • Default User Avatar

    in older javascript versions, Array.prototype.sort() was not guaranteed to be stable.

  • Custom User Avatar

    Yes, it's a Node specific issue, and not really a kata bug.
    You assume that elements which are not meant to be moved will stay on their original relative positions, which is not the case with sort in Node 8. sort can, in case of Node 8, reorder elements in any way as long as the final ordering satisfies requirements of your comparer. With input of [2,0,7] it's perfectly fine to get the sorted result of [7,2,0].

  • Custom User Avatar

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