Mental Model
We use a stack to keep track of opening brackets and check if each closing bracket matches the last opened one.
Analogy: Imagine stacking plates; you put a plate on top for each opening bracket and remove the top plate when you see a matching closing bracket.
Stack (top at right): []
Expression: ( [ { } ] )
ā start here