Given a string s representing a mathematical expression, evaluate and return its result as an integer.
The expression string contains digits, addition '+', subtraction '-', multiplication '*', division '/', and parentheses '(' and ')'.
Note: The integer division should truncate toward
.
Constraints:
s.length
s consists of digits, '+', '-', '*', '/', '(', and ')'.
s is a valid expression.
Given a string s representing a mathematical expression, evaluate and return its result as an integer.
The expression string contains digits, addition '+', subtraction '-', multiplication '*', division '/', and parentheses '(' and ')'.
Note: The integer division should truncate toward
.
Constraints:
s.length
s consists of digits, '+', '-', '*', '/', '(', and ')'.
s is a valid expression.