Question: BJP5 Exercise 12.14: dedup Write a recursive method called dedup that takes a string as a parameter and that returns a new string obtained by
BJP5 Exercise 12.14: dedup
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.
MUST BE RECURSIVE!!!!!!!!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
