Ad
  • Custom User Avatar

    When two numbers have the same "weight", let us class them as if they were strings (alphabetical ordering) and not numbers

    1 comes before 2 as strings, like a comes before b. The order they have in the original string doesn't matter.

  • Custom User Avatar

    C#

    Little confused on the 2nd test case and how it is correct according to directions and output of my code, I'm probably mistaken considering others have finished the C# Kata.

    The 2nd test case states that the following:

    2000 10003 1234000 44444444 9999 11 11 22 123

    should return:

    11 11 2000 10003 22 123 1234000 44444444 9999

    However, I don't understand how this could be the case. The sum of digits in 2000 is 2 and the sum of digits in 11 is 2. 2000 comes before 11 in the original string passed in, and because of this 2000 in the returned string should come before 11. I think I am mistaken on how the alphabetization is supposed work to especially since other people have passed this Kata.

    Thanks for the fun Kata!

  • Custom User Avatar

    Read some posts below: JS sort is not always stable.

  • Custom User Avatar

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