Basic Calculator Iii
hard
1. Implement a basic calculator to evaluate a simple expression string. 2. String will contain only non-negative integers, '+', '-', '*', '/' operators, and open '(' and closing parentheses ')'. 3. All intermediate results will be in the range of [-2^31, 2^31 - 1].
Constraints
1. 1 <= s.length <= 10^4 2. s consists of digits, '+', '-', '*', '/', '(', and ')'. 3. s is a valid expression.
Format
Input
Input is managed for you
Output
Output is managed for you
Example
Sample Input
2*(5+5*2)/3+(6/2+8)
Sample Output
21
Question Video