Recursion duplicate formating

can you give some hint for recursion duplicate formating

Hey @shrutikatyal, the main idea of this problem is that we have to separate adjacent similar words with star. I.e, they can be hello, helllo, hellllo etc. the output for these inputs will be hello , helllo , hellllo
So how would we approach this problem? Find first adjacent element and you got them at positions (I,j) where j=I+1 cause they are adjacent. Now move all the elements from j to size of array to one step forward and add “*” at jth position. Check the adjacent element till you reach endo of the character. Hope this would help you :slight_smile:

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.