Duplicate Characters Using Recursion

Is this program alright i.e. is there any other optimal way?