Given a string s containing both lowercase and uppercase English letters, your task is to make it "great" by removing problematic character pairs.
A great string is one where no two adjacent characters are the same letter in different cases (like 'a' next to 'A' or 'B' next to 'b'). These problematic pairs create bad adjacencies that need to be eliminated.
The Process: You can repeatedly choose any two adjacent characters that form a bad pair and remove both of them. Continue this process until no more bad pairs exist.
Goal: Return the final great string after all possible removals. The result is guaranteed to be unique, and an empty string is considered great too!
Example: "leEeetcode" โ "leetcode" (remove 'e' and 'E')
Input & Output
Constraints
- 1 โค s.length โค 100
- s contains only English letters (both lowercase and uppercase)
- Adjacent characters must be checked for same letter different case