>_
is_valid.py
Python 3.14
Not run yet

+ 7 hidden

Input
s = "{[()()]}"
Expected
true

Each pair closes inside the one that opened before it, and nothing is left open.