Randomised Quick Sort

One of the test case if not passing. It is showing run error. What is wrong in this code?
Code: https://ide.codingblocks.com/s/600393

hi… i have corrected ur code… https://ide.codingblocks.com/s/600897
its working fine now…

Thanks for the correction. But i am unable to understand why my code is wrong. I’d really appreciate if you could give me any test case(for which my code is failing), for which i can dry run my code and understand the mistake.

5
2 2 3 4 7
consider this input… ur code is failing over here…

hi… is ur doubt cleared now???

Yes. Thanks for the help.

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.