feat:s oivjsovji

This commit is contained in:
2026-01-23 23:11:32 -05:00
parent a2492aad21
commit 63e7b31184

View File

@@ -0,0 +1,11 @@
package besttimetobuyandsellstock
func MaxProfit(prices []int) int {
buy, sell := 1_000_000_000, 0
for _, price := range prices {
buy, sell = min(buy, price), max(sell, price-buy)
}
return sell
}