is it due to the for loop
Whats wrong in this code
hello @pranjuldwivedi120568
this question is straight forward.
read array.
call next_permutation on that array.
print the array.
whatever condition mentioned in the problem is already taken care by next_permuation