383. Eliminate Repeated Characters
0
Medium
Given a string, create a recursive function that produces a new string where all consecutive duplicate characters are reduced to a single character. For example, if the input is 'hello', the output should be 'helo'. Display the resulting string.
Input Format
Enter the string
Output Format
Display the resulting string
Example
Input
hello
Output
helo
Constraints
None
Loading...
View Submissions
Console