wrote an O(n^2) algorithm…but repeatedly getting TLE…can anyone please confirm whether this problem demands even better solution or not?
obviously it needs a better solution as you know that n<=200000 and number of test cases are 10.and you should also know that computer can process about 10^8 instructions per sec.
thanks a lot…i will try to improve my solution!!
best of luck