I’ve just understood to find all the words possible by rearranging. What is meant by dictionary order larger or smaller.All test cases failed.
https://ide.codingblocks.com/s/162492
Recursion-Dictionary Order(Larger)
The problem is exactly similar to the one in which you are generating all of the permutations of given string and all you need to do is to keep track of the original String too and in the base case just check the answer to be printed must be larger than original String, that means in the sample input, you are given cab, so all permutations that need to be printed has to be greater than cab, so it would only be cba…
2 Likes
Also, I have edited your code now, based on the same logic wht I have told earlier here, refer to it, and then try to submit it…
1 Like
Okay…thank you for the explanation:)
Why are we removing the backtracking line from the code of string permutations for this qstns code?