Evaluate Arithmetic Expression with Precedence

Asked at DoorDash · Coding Questions · Difficulty: Medium · Last asked Apr 6, 2026

Evaluate an arithmetic expression given as a string. It contains non-negative integers and the operators `+`, `-`, `*` and `/`, possibly separated by spaces. There are no parentheses.

Loading the problem…