Hi, while solving 1702C — Train and Queries I was constantly getting TLEs in Python. While when I tried to submit the solution in JAVA with the same approach it got accepted. Java Solution -> https://codeforces.net/problemset/submission/1702/164153330 Python Solution -> https://codeforces.net/problemset/submission/1702/164151905 (Also submitted in PyPy, it didn't work either)
I want to know what causes the issue? and how to prevent it...