only 1 test case is passing and rest of them getting TLE due to my O(n^2) approach, please tell me how to optimize my approach
Getting TLE in the code
Try this:
only 1 test case is passing and rest of them getting TLE due to my O(n^2) approach, please tell me how to optimize my approach
Try this: