NewProject Coding is here — build features and fix bugs in real codebases with an AI assistantSee what's new

(This question is a variation of the LeetCode question 224. Basic Calculator. If you haven't completed that question yet, it is recommended to solve it first.)

Given a string that represents a mathematical expression composed of spaces, numbers, and parentheses "( and ")", and the operations "add" and "mul". Evaluate the expression and compute the expression result.

Test Cases
Input
Output
Expected