Make The String Great

Easy

Topics
StringStack

A good string has no two adjacent characters where one is the lowercase and the other the uppercase of the same letter. Repeatedly remove such pairs from s and return the result.

Example 1

Input:  s = "leEeetcode"
Output: "leetcode"

Example 2

Input:  s = "abBAcC"
Output: ""

Constraints

  • 1 <= s.length <= 100
  • s contains upper and lower case English letters.
Run ⌘' · Submit ⌘⏎