Approach hintTry it first, then revealHide
Scan once while tracking the lowest price seen so far; the best profit is the largest difference between the current price and that running minimum.
Scan once while tracking the lowest price seen so far; the best profit is the largest difference between the current price and that running minimum.