I have submitted the code at the link https://ide.codingblocks.com/s/238514. It is showing TLE. The constraints are test cases<=10 and n<=100000. The complexity of this algorithm is O(N log N). Could not understand how to avoid TLE.
I have submitted the code at the link https://ide.codingblocks.com/s/238514. It is showing TLE. The constraints are test cases<=10 and n<=100000. The complexity of this algorithm is O(N log N). Could not understand how to avoid TLE.