Changed Solution
The pbds solution runtime is so close to the time limit. So, a little optimization may help.
I just declared the arr for every n. Still not a valid optimization in the worst case for every tc it will show TLE.
Changed Solution
The pbds solution runtime is so close to the time limit. So, a little optimization may help.
I just declared the arr for every n. Still not a valid optimization in the worst case for every tc it will show TLE.