Skip to content

Commit 0f385a7

Browse files
authored
Format code in README.md for consistency
1 parent d7e5e35 commit 0f385a7

File tree

1 file changed

+6
-5
lines changed
  • solution/0700-0799/0772.Basic Calculator III

1 file changed

+6
-5
lines changed

solution/0700-0799/0772.Basic Calculator III/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,24 @@ class Solution:
8080
while q:
8181
c = q.popleft()
8282
if c.isdigit():
83-
num = num*10 + int(c)
84-
if c == '(':
83+
num = num * 10 + int(c)
84+
if c == "(":
8585
num = dfs(q)
86-
if c in '+-*/)' or not q:
86+
if c in "+-*/)" or not q:
8787
match sign:
8888
case "+":
8989
stk.append(num)
9090
case "-":
9191
stk.append(-num)
9292
case "*":
93-
stk.append(stk.pop()*num)
93+
stk.append(stk.pop() * num)
9494
case "/":
95-
stk.append(int(stk.pop()/num))
95+
stk.append(int(stk.pop() / num))
9696
num, sign = 0, c
9797
if c == ")":
9898
break
9999
return sum(stk)
100+
100101
return dfs(deque(s))
101102
```
102103

0 commit comments

Comments
 (0)