Time limit exceeded


Your submission didn’t complete in the allocated time limit.
I am getting above error even for any set of inputs.


Check your exit condition. You might have entered an infinite loop.


I can run my code in VisualStduio, and it comes back very quickly with the correct answer.
However, when running it here, I am getting the time limited exceeded error.