Brackets
Problem
Write a program that checks for correct placement of parentheses in an arithmetic expression. Three types of brackets are used:
( )
,
[ ]
and
{ }
.
Input
The input is a string.
Imprint
Print
Yes
if the correct line contains parentheses. Otherwise, output
No
.
Examples
# |
Input |
Output |
1 |
(5+7)*[5+{(4+3)*[9-6]+7}-8] |
Yes |
2 |
[(2+3) |
No |