Question
Glitchy Keyboard Cleanup
A keyboard sometimes types the same character twice in a row. Whenever two equal adjacent characters appear, the system immediately deletes that pair.
This process continues repeatedly until no adjacent equal pair remains in the string.
Given the typed string, print the final cleaned string.
Note: If all characters are removed, print EMPTY.
Input
The first line contains KaTeX can only parse string typed expression. For each test case, one line contains string KaTeX can only parse string typed expression.
Output
For each test case, print the cleaned string or KaTeX can only parse string typed expression.
Example
Example 1:
Input
Example 2:
Input
Input
1
abbacaOutputcaExample 2:
Input
1
azxxzyOutputay