Ad
  • Custom User Avatar

    Thank you so much for leaving a breakdown of what each step in your sript does.

  • Custom User Avatar

    You need to find a solution that involves swapping digits around. I cannot read your code because I do not know enough, but I tried both methods of:

    1. adding 1 to the number until it had the same digits
    2. finding all possible combinations of an int's digits, sorting them, and returning ([the index of the original number] + 1)

    both methods were too slow, and would time out.

    the key is logically swapping digits around.