Evaluate arithmetic expression

Write codeMedium30 minMeta style

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) -> int
Example 1
Inputbasic_calculator("3+2*2")
Output7