Difficulty in understanding solution

I am finding it difficult to understand the solution for the question Recursion - Dictionary Order(larger)

Hello @parth_gupta

Here is the code
I have added comments for better understanding

In this approach what we do is
Consider every permutation of the string in ANY order and push it in a set
Print the contents of the set which are greater than the original string

A set is a data structure which keeps unique elements in a balanced binary search tree and can be used to get the elements in a sorted order (lexicographically sorted).
Example if we push 2, 3, 1, 2, 3, 5 in the set and print the contents then the output will be 1, 2, 3, 5 (unique sorted elements).