Super Reduced String
EasyP3Coding
In one operation you may choose two adjacent equal letters in s and delete both. Repeat this as long as possible, and return the resulting string. If nothing remains, return the exact text Empty String.
The result does not depend on the order in which you delete pairs.
Example 1
- Input
- s = "aaabccddd"
- Output
- "abd"
Example 2
- Input
- s = "aa"
- Output
- "Empty String"
Example 3
- Input
- s = "abba"
- Output
- "Empty String"
Constraints
- 1 <= s.length <= 10^5
- s consists of lowercase letters.
Hints
Give it a real attempt first. Run shows which examples fail.
Saved automatically
Run checks the 3 visible tests, Submit all 12. ⌘Enter runs, ⌘⇧Enter submits.