All Posts
Leetcode 20: Valid Parentheses
You are given a string containing characters representing various types of brackets: ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’. Your task is to determine if the input string is valid. A string is considered valid if:
- Open brackets must be closed by the same type of brackets.
- Open brackets must be closed in the correct order.
- Every close bracket has a corresponding open bracket of the same type.