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:http://www.codechef.com/viewsolution/3971729 My java solution link is:http://www.codechef.com/viewsolution/3970249
Check and let me know.