How can adding a comment on top make a code run?
AC (any comment on top) - CodeChef: Practical coding for everyone
TLE(original code) - CodeChef: Practical coding for everyone
The problem lies somewhere in the functions I wrote between lines 1-57 ( which are not necessary for the problem at all). Commenting out/ removing even one of the functions also makes the code run.
TLE (Original ) - CodeChef: Practical coding for everyone
AC (one the functions removed) - CodeChef: Practical coding for everyone
A similar thing happened during prev April Cookoff Div2 Problem A, where I had to change my input statement to get over TLE. ( I was taking input in a list and then converting it to set)
TLE - CodeChef: Practical coding for everyone
(using stdin which is probably is the fastest )
TLE - CodeChef: Practical coding for everyone
(using input().split() and map it to list of int)
AC - CodeChef: Practical coding for everyone
(using input().split() and map it to set of int)
Idk why all of these errors occured, please let me know, and thank you for going through my doubt.