mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-11 21:10:58 +08:00
Change 'len' to 'length'
This commit is contained in:
@ -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]
|
||||||
|
Reference in New Issue
Block a user