The SA Quant 2026 top picks portfolio, heavily weighted to AI and data center stocks, has gained over 50% YTD. Click for more ...
While solving this problem, I learned: The minimum price must always come before the selling day. Keeping track of the lowest price seen so far allows us to calculate the best profit at every step.