Loading problem…
You're building a calculator app that needs to evaluate mathematical expressions. The calculator should handle addition, subtraction, parentheses, and spaces, but no multiplication or division.
Given a string s representing a valid expression, implement a basic calculator to evaluate it, and return the result of the evaluation.
Note: You are not allowed to use any built-in function which evaluates strings as mathematical expressions, such as eval().