what is wrong in this logic?
Next permutation
can you please explain why my logic is wrong?
did not require the commented code just use the ssimple functino next_permutation it does everything for u
but how does it manage the condition that if the number given itself is the largest of all permutation then print the smallest one as in case of 3 2 1
we have to print 1 2 3
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.