AmazonSoftware Engineer · OnsiteCodemia practiceEvaluate a Promotion Pricing Formula With Parentheses and Precedence
Pricing rules are stored as integer expressions like `(price - 3) * 2 + -qty / 4` already substituted to numbers, e.g. `(40 - 3) * 2 + -7 / 4`. Evaluate the string with +, -, *, /, unary minus, and parentheses, where division truncates toward zero, without using eval.