next_permutation fn will always return something other than 0 so why would the do-while get to end???
Did not get question no 10
hello @anujsharmabadboy
next perm returns 0 , if next greater permuation doesnt exist (ie if array is sorted in descending order).
so for that it return 0 and change the array in ascending order
got it
thank u bhai …
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.
but this vector is in ascending order and next_permutation is returning 1 and not 0
…
pls read my first rsponse again