Boolean expression evaluator
Your task
A boolean expression is given as a string using the grammar: t (true), f (false), !(expr) (NOT), &(e1,e2,...) (AND of one or more sub-expressions), and |(e1,e2,...) (OR of one or more sub-expressions). Sub-expressions are comma-separated and may nest arbitrarily. Parse and evaluate the expression and return the resulting boolean. Assume the input is always well-formed.
Examples
parse_bool(expr: str) -> boolExample 1
Input
parse_bool("&(t,f)")Output
False