← Arena
Best Time to Buy & Sell StockEASY
🌐
ArrayGreedy

Given prices array where prices[i] is the price on day i. Maximize profit by choosing one day to buy and another day later to sell.

Input: prices = [7,1,5,3,6,4]
Output: 5
Buy day 2 (price=1), sell day 5 (price=6). Profit=5.
Input: prices = [7,6,4,3,1]
Output: 0
No profit possible.
AmazonGoldman SachsGoogleRazorpay
🌳 STRATEGY TREE MAP
🔬 X-RAY LIVE VISUALIZATION
Loading X-Ray…
🖊

Visualization dekh li? Ab Code Likho!

Upar jo visualization dekhi, usi ke according code likho.
Sirf 20% sahi code likhne pe full solution unlock ho jaega! 🔓

Vizlox — See Code Come Alive