Practice Minimum String Length After Removing Substrings
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given a string s consisting only of uppercase English letters. You can apply some operations to this string where, in one operation, you can remove any occurrence of one of the substrings "AB" or "CD" from s. Return the minimum possible length of the resulting string that you can obtain. Note that the string concatenates after removing the substring and could produce new "AB" or "CD" substrings.
Source: Minimum String Length After Removing Substrings on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
s = "ABFCACDB"
2
# Example 2
s = "ACBBD"
5
Constraints
Related LeetCode Problems
Practice more problems similar to Minimum String Length After Removing Substrings.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.