how should i solve this question , which approach will help me ???
Recursion codes of the string
hi @deepshreyamishra301_1918130c8477386b,
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.
refer here for implementation
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.