how to check whether charACTER IS dUPLICATE or not??
dUPLICATE character formatting
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.