initial commit

This commit is contained in:
wt committed 2026-04-08 15:12:07 +07:00
commit 942e4e2dc1
30 files changed
+297

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
#include <vector>
inline int maxProfit(std::vector<int> &prices) {
int profit = 0;
for (int i = 1; i < int(prices.size()); i++) {
if (prices[i] > prices[i - 1]) {
profit += prices[i] - prices[i - 1];
}
}
return profit;
}