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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!