678. Valid Parenthesis String
Practice Valid Parenthesis String for free on NudgeCode: Medium, Greedy pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.
s contains only (, ) and *. Each * can act as (, as ), or as nothing. Return true if some choice for the stars makes s a balanced parenthesis string.
Example
s = "(*)" -> true
s = "(*))" -> true
s = ")(" -> false
Constraints
- 1 <= s.length <= 100
- s[i] is '(', ')' or '*'