Skip to content

Commit f90ebe4

Browse files
Merge pull request neetcode-gh#2900 from cbangera2/updatePython150
Update 0150-evaluate-reverse-polish-notation.py
2 parents 8d90126 + 177de53 commit f90ebe4

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
elif c == "/":
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
return stack[0]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy