Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3573. Best Time to Buy and Sell Stock V
Given daily prices and an integer k, pick at most k non-overlapping transactions (each is a pair of days i<j where you either buy-then-sell or short-sell-then-buy) to maximize total profit. Equivalently, choose up to k disjoint index pairs to maximize the sum of the absolute price differences |prices[j] - prices[i]|.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.