Leetcode | 20. Valid Parentheses | Java | C#

Published: 09 October 2020
on channel: CodeOnline
751
8

Leetcode | 20. Valid Parentheses | Java | C#

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

An input string is valid if:

Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order.


Example 1:

Input: s = "()"
Output: true
Example 2:

Input: s = "()[]{}"
Output: true
Example 3:

Input: s = "(]"
Output: false
Example 4:

Input: s = "([)]"
Output: false
Example 5:

Input: s = "{[]}"
Output: true


On this page of the site you can watch the video online Leetcode | 20. Valid Parentheses | Java | C# with a duration of hours minute second in good quality, which was uploaded by the user CodeOnline 09 October 2020, share the link with friends and acquaintances, this video has already been watched 751 times on youtube and it was liked by 8 viewers. Enjoy your viewing!