Skip to content
C

Balanced Parentheses

Easyjavapythonccppjavascript

Given a string containing only the characters (), {} and [], determine whether every bracket is correctly opened and closed in the correct order.

Input Format

A single line containing the bracket string S.

Output Format

Print 1 if the brackets are balanced, otherwise print 0.

Input (stdin)

Output

Run your code to see output here...