Question: NEEDS TO BUILD AND RUN IN JAVA Given a string, return recursively a cleaned string where adjacent chars that are the same have been reduced
NEEDS TO BUILD AND RUN IN JAVA
Given a string, return recursively a "cleaned" string where adjacent chars that are the same have been reduced to a single char.
So "yyzzza" yields "yza". stringClean("yyzzza") "yza"
stringClean("abbbcdd") "abcd"
stringClean("Hello") "Helo" public static
String stringClean(String str)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
