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).
Because of this bug was getting TLE in the contest too inspite of correct solution.
Codechef should re-evaluate JAVA submissions. and check for the bug. @admin @codechef
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.
It is probably due to pypy3 being 2x faster.
But there are some cases where python 3.6 gets accepted and pypy3 gives tle, look at this for yourself : CHEFSHIP pypy3