Given a string s containing only three types of characters: '(', ')', and '*', return true if s is valid.
The following rules define a valid string:
'(' must have a corresponding right parenthesis ')'.')' must have a corresponding left parenthesis '('.'(' must go before the corresponding right parenthesis ')'.'*' could be treated as a single right parenthesis ')', a single left parenthesis '(', or an empty string "".Input: s = "()" Output: true Explanation: A simple matched pair.
Input: s = "(*)"
Output: true
Explanation: '*' is treated as ')' to match '(', or as '' leaving just ().
Input: s = "(*))"
Output: true
Explanation: '*' is treated as '(' giving "(())", or as '' giving "()" with a trailing ')'. Either way it is valid.
'(', ')', or '*'.s = "()"