Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf90ebe4

Browse files
Merge pull requestneetcode-gh#2900 from cbangera2/updatePython150
Update 0150-evaluate-reverse-polish-notation.py
2 parents8d90126 +177de53 commitf90ebe4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎python/0150-evaluate-reverse-polish-notation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def evalRPN(self, tokens: List[str]) -> int:
1111
stack.append(stack.pop()*stack.pop())
1212
elifc=="/":
1313
a,b=stack.pop(),stack.pop()
14-
stack.append(int(b/a))
14+
stack.append(int(float(b)/a))
1515
else:
1616
stack.append(int(c))
1717
returnstack[0]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp