Please can you explain what is next permutation means with an appropriate example?
thankyou:)
Please can you explain what is next permutation means with an appropriate example?
thankyou:)
hi @sonu28sharma99 do you understand what permutations are?
Lets say we sort all the possible permutations of a string in dictionary order, then next_permutation of any string means that what will be the next permutation in that dictionary order
for eg string = “abc”
and possible permutations are “abc, acb, bac, bca, cab, cba”
now for “bac” you can see that the next permutation in dictionary order will be bca