Hi , I'm Getting TLE error on some python solutions so i used accepted python solutions also still tle error what is wrong with my code
Accepted Python Solution but now i'm getting TLE : SOlution Link
Exact copy paste solution still TLE : MY Solution
EDIT : I do not know what's happening this solution also gives TLE But Algorithm Time Complexity is O(n) it should work fine can anyone help me.
Maybe the version of python changed since and the input became slower. Personnaly to make input faster I do that: import sys to_read = sys.__stdin__.read().split("\n")[::-1] for k in range(int(to_read.pop())): n=int(to_read.pop()) a=list(map(int,to_read.pop().split())) b=list(map(int,to_read.pop().split())) similarly I use a join to print everything with only one call
I also used these same thing but still getting TLE error. it started happening from last 2-3 days
for me in pypy2 it worked in 779 ms