Nzec error on every solution

I copied the input that you guys have given and it works perfectly fine on other ide(s) but on codechef it shows nzec error please help out it is very annoying .I tried adding space in split function but it didn’t help .

Link to my solution

In line 8 try changing input().split() to input().strip().split()

no change still getting the error

Your submission page does not show that you submitted it.

I made a submission with the change I suggested and got rid of the NZEC. (still WA but that’s not my concern)

One if the possible reasons is counter of loop may be exceeding size of array. This was problem in my code.

Well actually you have declared an empty list named “book” and later you are trying to input data from comprehension. Well the list is already null and to input data to it, you have to use “append()” method as no value exist for “book” at any index value.
Solution = simply delete the “book = []” part.

Happy to help! (´・ω・`)