>_
is_valid.kt
Kotlin 2.4
Not run yet

+ 7 hidden

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

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