Merge pull request #2664 from YingfanGu/master

修复 0121. 买卖股票的最佳时机 一处typo
This commit is contained in:
程序员Carl
2024-08-04 09:39:09 +08:00
committed by GitHub

View File

@ -308,7 +308,7 @@ class Solution:
class Solution: class Solution:
def maxProfit(self, prices: List[int]) -> int: def maxProfit(self, prices: List[int]) -> int:
length = len(prices) length = len(prices)
if len == 0: if length == 0:
return 0 return 0
dp = [[0] * 2 for _ in range(length)] dp = [[0] * 2 for _ in range(length)]
dp[0][0] = -prices[0] dp[0][0] = -prices[0]