Ad
  • Custom User Avatar

    everything is correct with logic

    Nothing is correct with this logic. You're providing only partial implementation of sort function. It may work in later node versions, but you can't rely on that.

  • Custom User Avatar
    expected '[9,9,9,9,1,2,1,1,3,1,0,0,0,0,0,0,0,0,0,0]' to equal '[9,9,1,2,1,1,3,1,9,9,0,0,0,0,0,0,0,0,0,0]'
                your function returned this                               this was the expected value
    

    Fix your code.