In a Meta-style coding interview, implement a basic calculator that evaluates an arithmetic expression stored as a string. The expression may contain non-negative integers, spaces, parentheses, and the operators +, -, *, and /.
Return the integer result of the expression. Division should truncate toward zero.
sYou may assume the input expression is valid.
Example 1
s = "1 + 2 * 3"72 * 3 = 6, then 1 + 6 = 7.Example 2
s = "(1 + (4 + 5 + 2) - 3) + (6 / 2)"12(4 + 5 + 2) = 11, then (1 + 11 - 3) = 9, and (6 / 2) = 3, so the final result is 12.1 <= len(s) <= 10^5s contains digits, spaces, +, -, *, /, (, )