Ad
  • Custom User Avatar

    Not in the string, as a string.

    When two numbers have the same "weight", let us class them as if they were strings and not numbers: 100 is before 180 because its "weight" (1) is less than the one of 180 (9) and 180 is before 90 since, having the same "weight" (9) it comes before as a string.

  • Custom User Avatar

    Test case input : "210 202 114 132 116 710 414 36 342 352 118 362 246 76 418 238 176 276 474"
    Expected test case output: "210 202 114 132 116 710 342 36 414 118 352 362 246 238 418 76 176 276 474 378 774 388 578 "
    The instruction says that the numbers with the same weight are ranked by which number comes first in the string so in that way the rank should be 414 should preceed 36 and 342. I believe there is something wrong with either the test cases or the instructions provided. If the instructions are correct then the output should be
    210 202 114 132 116 710 414 36 342 352 118 362 246 76 418 238 176 276 474