Valid Parentheses Extended

Medium
Strings Stack
Given a string containing '(', ')', '{', '}', '[', ']', determine if the input string is valid. Extended: also handle nested structures. Output: true or false

Constraints

1 <= s.length <= 10000

Examples

Example 1:
Input: ()[]{}
Output:
Example 2:
Input: (]
Output:

Hints

Use a stack.
Push opening brackets, pop for closing.
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.