My code is running and giving correct answer in PyCharm but CodeChef says Runtime Error

I wrote my code in Python 3.7 in Pycharm and it is giving the correct answer upon the input test cases provided by code chef. It is giving NZEC error. The traceback says list assignment index out of range. I checked StackOverflow but nothing worked. I ran my code in and it is also running successfully there.

let’s say you have a list containing 3 items. but you are trying to access the 4th item, which is not even there. then you will get such an error.

Thanks for your comment. I know what causes that error. I printed the variables it was not ‘index out range’. I ran the same codes on other platform and it’s running successfully. But not here.


It’s hard to figure out what’s going on without knowing your code and test cases you are trying

If you didn’t give custom input, it will cause a runtime error, because your code doesn’t get tested on sample test cases, rather it gets tested on empty input.

Thank You very much

I will update you the block. Wait…