i have first find all permutaion of given string and stored them all in vector. Then i have find the index of the input string which must be a one of the output of permutation. Then i sort them and run a loop from the that index to end of the vector and print them.
ide: https://ide.codingblocks.com/s/194437
Dictionary order larger
but not getting correct output. please check approach
Refer this…It is similar to dictionary order smaller…just you need to reverse the comaprison sign.
Output must be sorted.So instead of printing the result in base case, push it into a vector. Then sort the vector in the main and then print the result.