Recursion subsequences-code error

here is the ques:
https://hack.codingblocks.com/contests/c/452/73
here is my rough code:
http://ide.codingblocks.com/#/s/18719
I am trying to copy the out string to m[i](ive creted a map for that),
after that i waNT to sort it and then print it in order.
please attend to this and suggest the modification needed.

swapnil try to do it with recursion
check this
http://ide.codingblocks.com/#/s/18739