# LC3975 Maximum Score From Removing Substrings AB/BA (interview notes)

## Problem
String of X/Y (or A/B). Removing "AB" scores x, "BA" scores y. Maximize score by greedy order.

## Approach
Always remove the higher-scoring pattern first with a stack, then the other. Order matters; prove by exchange.

## Practice tip
Stack + greedy score tricks: drill them via [learn more](https://www.linkjob.ai/).
