Ad
  • Custom User Avatar

    Hey there, sorry it took so long to get back to you. Your issue is that you are editing the variable n. The random tests are then taking your solution's n and running it back through the algorithm. Instead of doing this, try duplicating n to some other variable and your solution should work fine. You will have issues with many other solutions if you continue editing the variable passed to you, so I would recommend never doing it.

  • Custom User Avatar

    If you wouldn't mind, could you post your solution here with spoiler tags? I would like to see what you are seeing with the random tests.

  • Custom User Avatar

    Slightly modified, thanks!

  • Custom User Avatar

    Try to avoid sorting.