← MakeMyTrip questions

Maximum profit from multiple stock buy and sell transactions

Filed under MakeMyTrip

Given an array of prices where prices[i] is the price of a stock on the i-th day, find the maximum profit by completing as many transactions as you like.

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

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