Back to Questions

Best Time to Buy and Sell Stock (I)

21.4K viewsAsked at Amazon
Easy

Question Explain

You are given an array of prices where `prices[i]` is the price of a given stock on the $i$-th day. Find the maximum profit you can achieve. Solve in $O(n)$.

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question
Best Time to Buy and Sell Stock (I) - Interview Question