Question: Write a recursive method called dedup that takes a string as a parameter and that returns a new string obtained by replacing every sequence of
Write a recursive method called dedup that takes a string as a parameter and that returns a new string obtained by replacing every sequence of repeated adjacent letters with just one of that letter. For example, the string "bookkkkkeeper" has three repeated adjacent letters ("oo", "kkkkk", and "ee"), so the call of dedup("bookkkkkeeper") should return "bokeper". Do not call the string replace or split methods in your solution.
Step by Step Solution
3.49 Rating (159 Votes )
There are 3 Steps involved in it
public st... View full answer
Get step-by-step solutions from verified subject matter experts
