Evaluate arithmetic expression
Your task
Evaluate a basic arithmetic expression string containing non-negative integers and the binary operators +, -, *, / separated by the operators (and possibly spaces). There are no parentheses. * and / have higher precedence than + and -, and integer division truncates toward zero (so 14 - 3/2 = 14 - 1 = 13). You may assume the expression is valid and the result fits in a signed 32-bit integer. Return the integer value.
Examples
basic_calculator(s: str) -> intExample 1
Input
basic_calculator("3+2*2")Output
7