Porter route events use a compact marker string where ( represents an opening event, ) represents a closing event, and * may represent an opening event, a closing event, or no event. Given a marker string s, determine whether at least one interpretation produces a valid parenthesis sequence.
A valid sequence has balanced parentheses, every closing parenthesis matches an earlier opening parenthesis, and all parentheses are matched at the end.
Implement valid_parenthesis_string(s). The input is a string containing only (, ), and *. Return True if some interpretation of every * makes s valid, otherwise return False.
def valid_parenthesis_string(s):