← Expedia questions

Maximum profit by buying and selling stock at most k times

Filed under Expedia · Also reported at Navi

You are given an integer array prices where prices[i] is the price of a given stock on the i-th day, and an integer k. Find the maximum profit you can achieve by buying and selling a share at most k…

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

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