At Stripe, you need a reliable evaluator for arithmetic expressions used in internal rule configs. Given a string s representing a valid expression, compute its integer result.
s: str containing digits, spaces, operators + - * /, and parentheses ( ).int value of the expression.* and / before + and -.+/- may appear at the start or immediately after (.s = "2*(3+4)" → 14
(3+4)=7, then 2*7=14.s = " 14 - (6/2 + 3) * 2 " → 2
6/2=3, (3+3)=6, 6*2=12, 14-12=2.s = "(1-4)/2" → -1
(1-4)=-3, -3/2 truncates toward zero → -1.1 <= len(s) <= 200000