RECURSION-DICTIONARY ORDER (explain the approach please)

Are we supposed to find all the permutations then store it in a array than display the smaller strings. or do we have to think of any other approach.

question: