let's try this again shall we

problems 1->10 of LC150
This commit is contained in:
2025-06-03 20:23:08 -07:00
parent ac27bdd840
commit 151d0214ff
10 changed files with 166 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
def maxProfit(self, prices: list[int]) -> int:
cur_start = 0
diff_sum = 0
for idx in range(1, len(prices)):
if prices[idx] > prices[cur_start]:
diff_sum += prices[idx] - prices[cur_start]
cur_start = idx
return diff_sum