Next Permutation

Can you explain the algorithm

hello @Shubh-Garg-2556190207986238
pls refer this article -> link

it contain visualization of algorithm as well.
feel free to ping me back incase u need any help


i try the code and all test case passed except test case 0

@Shubh-Garg-2556190207986238

becuase u r already using next perm function there is no need to handle anything else.
simply print ur array after calling next perm