Im not able to append the * with the character

can you please correct my code as in unable to append * in front of repeated character .

@1999atrijsharma,
Your approach was wrong. if you have to use recursion then don’t use a for loop.

https://ide.codingblocks.com/s/333563 corrected code