โ† Intuit questions

Maximum profit stock problem in O(n)

Filed under Intuit

Given an array of prices where prices[i] is the price of a stock on the i-th day, find the maximum profit by choosing a single day to buy and a different day to sell.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Intuit questions

Collected from public candidate posts and coding forums. Updated Nov 2026.