Ad
  • Custom User Avatar
  • Custom User Avatar

    Your post is formatted in reverse, your rext is in a codebox but your code isn't. You might want to read the FAQ for information on how to format posts. Also please mention which programming language you are using next time.

    You have just encounted a common mistake. You are sorting an array of strings, which is very different from sorting an array of numbers.
    For example "4" would be considered higher than "1111", because the first char is higher. However when comparing numbers, 1111 is clearly a higher value than 4.

  • Custom User Avatar

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