>_
is_valid.go
Go 1.26
Not run yet

+ 7 hidden

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

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