Valid Parentheses

Given a string *s* containing just the characters `'(', ')', '{', '}', '['` and `']'`, determine if the string is valid (every opening bracket closed by the same type in correct order).

Input Format

One line string s.

Output Format

"true" or "false".

Constraints

  • 0 <= len(s) <= 10^4.

Examples

Example 1:

Input:

()[]{}

Output:

true

Explanation:

Each bracket is properly closed in order.

Loading...
Valid Parentheses - Strings DSA Problem