Not able to pass test cases

I am not able to find the error in the code
and getting right output

Help to resolve this issue

u can simply use STL function next_permutation(arr,arr+n); to get next permutation.
ig sir has also explained this in one of the videos

I have used the Stl function next_permutation to get next permutation kindly check the code

next_permutation(arr,arr+3);
why are u writing 3 over here… write n… otherwise it will fail over other test cases

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.