Question: Write a recursive function which returns the input string but with adjacent duplicate characters removed. Do not use any String functions other than .charAt(), .length(),
Write a recursive function which returns the input string but with adjacent duplicate characters removed. Do not use any String functions other than .charAt(), .length(), .isEmpty() and .substring(). Do not use any loops. We recommend you use a helper function so we have provided the helper function header below.
public static String removeAdjacentDuplicateChars(String s) {
helper function header:
private static String removeHelper(String s, int index) {
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
