 All Problems
Valid Parenthesis String
medium
strings
greedy
dynamic programming
stack
amazon
google
microsoft
facebook

A string with '(', ')', and '*' (wildcard = empty / ( / )) is valid if parentheses balance. Return true or false.

Example 1:

Input:  (*)
Output: true

Example 2:

Input:  (*))
Output: true

Input format: A single string.

Run to check your code against the sample cases, or submit to run every case