ผลต่างระหว่างรุ่นของ "01204212/paren"

จาก Theory Wiki
ไปยังการนำทาง ไปยังการค้นหา
(หน้าที่ถูกสร้างด้วย ':from 01204212 You have a string consisting of parentheses ( ), curly braces { }, and brackets [ ]. You want to check if they are...')
(ไม่แตกต่าง)

รุ่นแก้ไขเมื่อ 20:46, 7 กันยายน 2559

from 01204212

You have a string consisting of parentheses ( ), curly braces { }, and brackets [ ]. You want to check if they are properly balanced. The following are examples of balanced strings:

(()())(())((())())
[()[]]
{[]}{[][](()[])}

These are unbalanced strings:

)(
[[))
[{]}
{{{{}}}}}

You want to write a program that performs the balance checking.