brackets made up only of three kinds of brackets: round (), square [] and curly {}.
Check whether the brackets are well formed. That means every opening bracket is matched by a later closing bracket of the same kind, every closing bracket is matched by an earlier opening one, and the pairs nest properly: a bracket opened later must be closed earlier.
Return True if the string is well formed and False otherwise.brackets="{[]()}" → TrueInside the curly braces there are two closed pairs, [] and (), and then the curly brace itself is closed.
brackets="[(])" → False
The round bracket was opened last, but the square one is closed first, so the nesting is broken.
brackets="(()" → False
One of the round brackets is never closed.
brackets ≤ 10⁵brackets contains only the characters (, ), [, ], {, }brackets="{[]()}"True
Run checks the first 3 tests in your browser. Submit checks all 150 tests on the server, hidden ones included.