Description
Given a string s containing only '(', ')' and '*', return true if s is valid. '*' can be treated as '(', ')' or an empty string.
Examples
Input:
s = "()"Output:
trueExplanation:
Simple valid parentheses.
Input:
s = "(*)"Output:
trueExplanation:
* can be treated as empty.
Input:
s = "(*))"Output:
trueExplanation:
Given s = "(*))", the condition holds: s is valid.
Constraints
- •
1 ≤ s.length ≤ 100 - •
s consists of '(', ')' and '*'.