getting one test case 0 time limit and other test case as correct
Unlock one test case wrong
hey @Faizan-Ali-1395131367301898 when you don’t find the best spot you are traversing whole array for best spot which will cause TLE.instead of traversing whole array swap a[n-i] with a[i] and update there maps too and you are good to go.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.