my sol : https://ide.codingblocks.com/s/253573
i am not able to understand why the code is giving TLE on 2nd and 3rd TCs.
The code looks fine to me both in terms of space and time complexities.
Pls tell me where my code can be optimised or whether their is some problem with the TCs