We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3b1b89 commit 95e8873Copy full SHA for 95e8873
my-submissions/m122.py
@@ -0,0 +1,3 @@
1
+class Solution:
2
+ def maxProfit(self, prices: List[int]) -> int:
3
+ return sum(filter(lambda x: x > 0, [y - x for x, y in zip(prices[:-1], prices[1:])]))
0 commit comments