Skip to content

Commit

Permalink
fix: 增加关键点
Browse files Browse the repository at this point in the history
  • Loading branch information
lucifer committed Mar 11, 2021
1 parent 57ab9b2 commit c5bdb5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion problems/227.basic-calculator-ii.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ https://leetcode-cn.com/problems/basic-calculator-ii/

## 关键点解析

- 区分一目和二目运算符,并使用栈来简化操作
- 记录 pre_flag,即上一次出现的操作符
- 使用哨兵简化操作。一个是 s 的 $ ,另一个是 pre_flag 的 +

Expand Down Expand Up @@ -212,7 +213,6 @@ class Solution:
pre_flag = c
num = 0
i += 1
print(sum(stack))
return i, sum(stack)
s += '$'
return dfs(s, 0)[1]
Expand Down

0 comments on commit c5bdb5a

Please sign in to comment.