Duplicate character formatting

Hi,
Please give any hint on this problem.
thanks

Hey @vatsal50
In this question, the idea is to put a recursive function on the Array and print * if we got any repetitive character.

Algorithm:

  • Obtain the result for substring starting at index 1. Store this in another string , say ‘ros’ .
  • Check whether the first character of current string and first character of ros are same.
  • If so return , add a " * " to the new result and concatenate as s[0] + " * " + ros.
  • Else simply return s[0] + ros.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.