Evaluate Arithmetic Expressions
Evaluate the result of an arithmetic expression given as a string.
Statement
Given an arithmetic expression as a string, evaluate its result. For simplicity, let’s assume that there are no parentheses in the expression and only the following binary operations are allowed: (+
-
*
/
).
Examples
Here are a few examples of expressions and their results:
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.