← Amazon questions

Buy and sell stocks to maximize profit (1 action per day)

Filed under Amazon

Given an array of prices where prices[i] is the price of a stock on the i-th day, find the maximum profit you can achieve by completing as many transactions as you like (buy one and sell one share of…

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 Amazon questions

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