I was submitting the solution for this problem in the contest multiple times and was getting TLE everytime.
so I saw some solutions already submitted after thye contest and saw that my approach was same .
I figured something was wrong but not with my code .
so I copied and pasted the already submitted correct solution of the problem and submitted it with my account on the IDE and i was surprized to see the result.
It was TLE again.(for the already accepted solution).
I wonder if this is an interesting data point for this : an example where the multiplier for Python actually ends up acting in Python’s favour?
A Python solution for this Problem will have 5 seconds to run, and if string comparision in Python is roughly as fast as it is in C or C++ (seems like a fairly reasonable hypothesis: there’ll probably be a bit of constant overhead for the comparison call, but the raw comparison of strings of characters is probably performed by something written in C), then Python users might have an advantage for this particular Problem.