Python nzec error

i am getting a nzec error in python 3 while submitting a solution what should i do the code works fine on my offline compiler.It shows me error on the line where i am taking input for test cases.

If it’s not from the ongoing contest, you can post your code here.

the simple solution is to add a try-except block

like:


def solve():
        #code logic

try:
        #rest of your code here 
        #this is the driver code for example I use like this
        for _ in range(int(input()):
                solve()
except:
        pass
2 Likes