How to Print all the subsequences of a string in lexicographical order

I am able to generate all strings but how to sort it?
https://hack.codingblocks.com/contests/c/452/73
https://ide.codingblocks.com/#/s/15280

Use map to store the outputs and finally print it :wink:
https://ide.codingblocks.com/#/s/15315

just take an array of string like string s[100] then store the output in the string by maintaining index and then just sort the array using inbuild aort function sort(s,s+index)
and then just cout<<it