Basic Calculator II
Implement a basic calculator to evaluate a simple expression string.
The expression string contains only non-negative integers, +
, -
, *
, /
operators and empty spaces . The integer division should truncate toward zero.
Example 1:
Example 2:
Example 3:
Note:
You may assume that the given expression is always valid.
Do not use the
eval
built-in library function.
Last updated