My code is not passing a single test case

i feel my logic is correct

Try to implement randomized quick sort, since in worst case complexity of your code will be O(n^2), also change data type from int to long long as specified range is quite big.

Hope this helped you :blush:

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.