How to do this question without finding all permutation

i have done this just finding all permutation.
find only which is greater

Hey @officialharshit1996
Keep using next_permutation inbuilt function until u get a permutation smaller than current permutation

i don’t want to use inbuilt function, i want to find only those string which are lexicographically large by recursion

They @officialharshit1996
Then implement next_permutation urself
Here is the code for that ,see method 2: https://www.google.com/amp/s/www.geeksforgeeks.org/find-the-next-lexicographically-greater-word-than-a-given-word/amp/

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.