Beta

Scrambled Numbers Sorting

Description
Loading description...
Strings
Arrays
Algorithms
Puzzles
Sorting
View
AllIssues2Questions1SuggestionsShow Resolved
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    The kata needs sample tests.

  • docgunthrop Avatar

    This kata can be approved but it's lacking random tests.

  • ZozoFouchtra Avatar

    Some strange things happen in your tests :

    arrayToSort: [ '00', '0', '1', '4', '9', '10', '20', '25', '50', '75' ]
    Expected:    ["0","0","1","4","9","10","20","25","50","75"]  // '00' is now '0' !
    instead got: ["0","1","4","9","00","10","20","25","50","75"]
    
    arrayToSort: [ '000', '100', '200', '300', '400', '500', '600', '700', '800', '900' ]
    Expected:    ["0","100","200","300","400","500","600","700","800","900"] // '000' -> '0' !!!
    instead got: ["000","100","200","300","400","500","600","700","800","900"]
    
    arrayToSort: [ '000', '100', '200', '300', '400', '500', '600', '700', '800', '900' ]
    Expected:    ["00","300","800","900","000","100","500","200","400","700"] // '600' transformed to '99' !?!?!?
    instead got: ["600","300","800","900","000","100","500","200","400","700"]
    

    Hope you'll can solve this.

    ; ) )

    • CamWalker Avatar

      Hello ZozoFouchtra,

      The test cases are all correct. For the same reason you would write 15 instead of 015, the implied "zeroes" in the front of the numbers must be removed. In the last example, the number 6 represents zero and must be removed from the front of numbers where applicable.

    • ZozoFouchtra Avatar

      oooooKay ! Sounds better now. But i've still a little problem : 26 tests passed, 0 failed, but i can't submit !

       Time: 330ms Passed: 26 Failed: 0 
      

      Is there more than 26 tests ? Is there anything else do do ?

      ; ) )

    • aweleshetu Avatar

      I think the site has frozen. I wasn't able to submit as well. Turns out many warriors are suffering from same problem with other katas.

      https://github.com/Codewars/codewars.com/issues/893

    • ZozoFouchtra Avatar

      This comment has been hidden.

      Question marked resolved by ZozoFouchtra 8 years ago