I am just starting out with Python and was solving one of the problems from July challenges. I have solved the problem in C++ and translated that code to Python, however on submitting I observed that using
while loop instead of
for loop to iterate over the various test cases results in different outcomes.
Here is what I am doing:
results in RTE (NZEC)
t = int(input()) while t: # solve t -= 1
Results in AC
t = int(input()) for _ in range(t) # solve
I am using Python 3 and while submitting I have selected python3 compiler as well.