From 0638ba5ad88909b1463ccb43f55cb06f9bc88d09 Mon Sep 17 00:00:00 2001 From: Yuan Yuan Date: Thu, 26 Dec 2024 14:09:06 -0600 Subject: [PATCH] =?UTF-8?q?docs:=20150=E9=A2=98=E6=B7=BB=E5=8A=A0=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0150.逆波兰表达式求值.md | 1 + 1 file changed, 1 insertion(+) diff --git a/problems/0150.逆波兰表达式求值.md b/problems/0150.逆波兰表达式求值.md index 4ffe950b..5fb28c29 100644 --- a/problems/0150.逆波兰表达式求值.md +++ b/problems/0150.逆波兰表达式求值.md @@ -200,6 +200,7 @@ class Solution(object): else: op2 = stack.pop() op1 = stack.pop() + # 由题意"The division always truncates toward zero",所以使用int()可以天然取整 stack.append(str(int(eval(op1 + token + op2)))) return int(stack.pop()) ```