Minimum String Length After Removing Substrings
Push letters on a stack and pop whenever the top two form AB or CD, which is the only removal that matters.
Push letters on a stack and pop whenever the top two form AB or CD, which is the only removal that matters.