I am unable to do this problem. Pls tell the code.
Next permutation
pls tell the code for this problem
I am suggesting you an approach, please try to implement it yourself.

if you dont get any p in the first step… that is the corner case… you just need to reverse the array and print it.
thanks
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.
pls tell in the form of a code.
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.