Cisco interview question

Check if a string is balanced (with parentheses, brackets etc.)