I am getting a TLE in my python code whereas a code with the same complexity of O(n^2) in java, I am getting AC!!
My solution link for python is:CodeChef: Practical coding for everyone
My java solution link is:CodeChef: Practical coding for everyone
Check and let me know.
btw there is also an O(nlogn ) approach to solve this problem and with that certainly you will not get this veridict so i think you should check this out i have provided an explanation of that at the end::
http://discuss.codechef.com/questions/43403/approx2-editorial
if you like this answer dont forget to cast votes::