This is a heavily interactive web application, and JavaScript is required. Simple HTML interfaces are possible, but that is not what this is.
Post
sophie alpert
sophiebits.com
did:plc:lq6wgt3qcyog37cw65o5c277
perhaps it’s like this?
function maxTheStock(prices) {
let maxProfit = 0, minPrice = Infinity;
for (let price of prices) {
minPrice = Math.min(minPrice, price);
maxProfit = Math.max(price - minPrice, maxProfit);
}
return maxProfit;
}
2024-11-18T06:59:51.255Z