Question: Hi there! I need help with the following java program, Given a user inputted String come up with recursive method (no loops) to clean the
Hi there!
I need help with the following java program,
Given a user inputted String come up with 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 methodcleanString.
For Example:
- cleanString("yyzzza")-> "yza"
- cleanString("ggoonnee")-> "gone"
- cleanString("Hello")-> "Helo"
Input
n, where n is a String
Sample Input
yyzzza
Output
A "cleaned" String
Sample Output
yza Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
