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 6c7105c commit 8c2011eCopy full SHA for 8c2011e
best-time-to-buy-and-sell-stock/Lustellz.ts
@@ -1,5 +1,7 @@
1
function maxProfit(prices: number[]): number {
2
3
+ // Runtime: 1ms
4
+ // Memory: 66.23MB
5
let minPrice: number = prices[0];
6
let maxProfit: number = 0;
7
@@ -13,4 +15,7 @@ function maxProfit(prices: number[]): number {
13
15
}
14
16
17
return maxProfit;
18
+
19
+ // What I was planning to do: Recursion
20
+ // Result: referring other's code
21
};
0 commit comments