Valid Parentheses

Difficulty: Easy 🏷️ Topic: Stack

Given a string containing only the characters ()[]{}, determine if the brackets are balanced and correctly nested.

Input

Output

Example

Input:
{[]}

Output:
true

▶ Code & Judge
Your code runs against test cases in a sandbox. Solutions persist in this browser. Read input from stdin, print the answer to stdout.

Want the approach? Read the Valid Parentheses solution or browse all problems.

Discussion

Newest first
You