2023-07-01 11:58:00 -04:00
|
|
|
examples = [
|
|
|
|
|
"",
|
|
|
|
|
"[]",
|
|
|
|
|
"[][]",
|
|
|
|
|
"[[][]]",
|
|
|
|
|
"][",
|
|
|
|
|
"][][",
|
|
|
|
|
"[]][[]",
|
|
|
|
|
"[[[]"]
|
|
|
|
|
|
|
|
|
|
for str in examples
|
2026-02-01 16:33:20 -08:00
|
|
|
balanced = isBalanced(str)
|
|
|
|
|
if balanced then outcome = "is OK" else outcome = "NOT OK"
|
|
|
|
|
print """" + str + """ " + outcome
|
2023-07-01 11:58:00 -04:00
|
|
|
end for
|