Question: Given a user inputted String write a recursive method (no loops) to clean the String. A cleaned String is one where only adjacent characters that
Given a user inputted String write a recursive method (no loops) to "clean" the String. A "cleaned" String is one where only adjacent characters that are the same have been reduced to a single char. So "yyzzza" yields "yza". You should call your method cleanString.
For Example:
cleanString("yyzzza") -> "yza"
cleanString("ggoonnee") -> "gone"
cleanString("Hello") -> "Helo"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
