← Microsoft questions

Stock buy and sell time problem without loss

Filed under Microsoft

Given an array of stock prices over time, find a sequence of buy and sell transactions such that no transaction results in a loss. Maximize the total profit while ensuring every sell price is greater…

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

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