feat: osijvrsoi

This commit is contained in:
2026-03-06 19:17:30 -05:00
parent 2cac846a4d
commit aad6f3e91f
43 changed files with 136 additions and 0 deletions

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
}