Promblem
Analysis Process
1.Define two stacks,One is the numeric stack and the other is the symbol stack
2.Define symbol priority
3.Same-level symbols can pop up, low-level symbols can pop up high-level symbols (except open bracket)
4.The numeric stack and symbol stack are pushed in order, and the symbol stack determines the operation order according to the symbol level
Code
func calculate(s string) int {
num := 0 // Extract the Numbers in s
res := 0 // Returns the result of the calculation
sign := 1 //record operation symbol
stack := make(