Repeatedly remove adjacent letters that are the same alphabetic character but opposite in case, until the string becomes stable.
You are given a string consisting only of English letters.
A string is considered good if it does not contain any adjacent pair of characters where:
In one move, you may delete any such adjacent bad pair from the string.
Keep performing deletions until no more bad pairs remain. Return the final string after all possible removals.
The order of the remaining characters must stay the same as in the original string.
Example 1
Input
"leEeetcode"
Output
"leetcode"
Explanation
The substring "eE" cancels out, leaving "leetcode".
Example 2
Input
"abBAcC"
Output
""
Explanation
Each adjacent opposite-case pair can be removed until nothing remains.
Example 3
Input
"s"
Output
"s"
Explanation
A single character is already good.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.