#C5130. Balanced Brackets Checker
Balanced Brackets Checker
Balanced Brackets Checker
Your task is to determine if the brackets in a given string are properly nested and balanced. The string can contain various characters including letters, digits, operators and spaces. The only characters of interest are the brackets: (), [], {} and . A string is considered balanced if every opening bracket has a corresponding closing bracket in the correct order.
For example, the string "(a + b) * [c - {d/e} + ]" is balanced, while "(" is not. Print True
if the string is balanced; otherwise, print False
.
inputFormat
Input is read from standard input. It consists of a single line containing the string that you need to check for balanced brackets.
outputFormat
Output to standard output a single word: True
if the brackets are balanced, or False
otherwise.## sample
(a + b) * [c - {d/e} + ]
True