Ad
  • Custom User Avatar

    Try printing the input and test your code with that. Have you tried with this one? "71899703 200 6 91 425 4 67407 7 96488 6 4 2 7 31064 9 7920 1 34608557 27 72 18 81"
    Your sorting algorithm when the weight is the same, will only move the 9 to the end of the same weight group, leaving the rest as it is.
    Mark your post as having spoiler content next time.