Question
Remove Adjacent Duplicates
You’ve found an ancient parchment with a mysterious string of letters, but it appears cluttered with pairs of adjacent repeating characters. To reveal its true message, you need to clean up the string by removing any consecutive duplicate letters until no two adjacent characters are the same. Can you simplify the string to uncover the hidden message?
Input
The first line of the input consists of a string s of length n, containing only alphabetic characters (both upper-case and lower-case are possible).
Constraints
1 ≤ n ≤ 105
Constraints
1 ≤ n ≤ 105
Output
Print a string where all adjacent duplicate characters have been removed. If multiple solutions are possible, returning any of them is acceptable.
Example
Sample Input
aabbccddeeff
Sample Output
abcdef
Explanation
Every character is doubled. By removing one of each adjacent pair, we are left with "abcdef".
aabbccddeeff
Sample Output
abcdef
Explanation
Every character is doubled. By removing one of each adjacent pair, we are left with "abcdef".