Ad
  • Custom User Avatar

    You need a solution faster than O(n).

    Edit: Wait, if you can pass the 7th test (the test with very big numbers) it should already be faster than O(n). In that case I guess it's due to some edge cases triggering infinite loop?

  • Custom User Avatar

    Okay, now I see what's the problem. Fixed.

  • Custom User Avatar

    It might have to do with how you dealt with the Debug switch.

    Can you post your code in the reply (with spoilers)?