Valid Parenthesis String
Problem statement
Given a string s containing '(', ')', and '*', return whether it can become a valid parenthesis string.
Each '*' may independently represent an opening parenthesis, a closing parenthesis, or the empty string.
Function
checkValidString(s: String) → booleanExamples
Example 1
s = "(*)"return = trueThe wildcard may be empty.
Example 2
s = "(*))"return = trueTreat the wildcard as an opening parenthesis.
Constraints
0 <= s.length <= 10^5.scontains only(,), and*.