sir give me some hint about this problem
Dictionary order problem
@kumar_07 Let’s assume that the input word is cab . All the possible rearrangements for the word cab are :
abc
acb
bac
bca
cab
cba
Of all the above words, only cba will come after cab if arranged in a dictionary. So we have to print cba .
Basically, we have to print all those rearrangements of the input word which will come after the input word in the dictionary.