Getting runtime error every time codechef

Every time i run my code I’m getting runtime error. While using custom inputs it runs fine then if i try submitting it or running it without custom inputs it shows runtime error. For instance CodeChef: Practical coding for everyone is piece of code submitted which doesn’t give error with custom input otherwise it give runtime error. Help me if i have some coding style error in such case.

The variable j was getting out of range in your code (Why? I’ll leave that upto you to find - Use pen and paper). The pseudo-code below will work fine (You’ll still get WA though, and I’ll leave that to you too)
And you’ll always get RE when you RUN the code without custom input. You’ll have to provide some input if you want it to work. Thats how Codechef IDE works.

while j<n and Checkspare(line[j],spare)=='Yes':
	    if Checkspare(line[j],spare)=='No':
	        print('NO')         #//result.append('NO')
	    else:
	        print('YES')
	    j+=1        #//result.append('YES')