Best Time to Buy and Sell Stock III.
Unlock detailed company stats for this questionUpgrade
The problem was wrapped in a story; the closest LeetCode match, as the poster notes, is Best Time to Buy and Sell Stock III (maximum two transactions). Topic: 3D dynamic programming / state machine, hard difficulty. I gave the generalized solution for K transactions instead of hardcoding two, and the interviewer appreciated that it scaled.
Community answers
No answers contributed by the community yet.
Related questions
Best Time to Buy and Sell Stock.Best Time to Buy and Sell Stock IV.Best Time to Buy and Sell Stock - the DP version.Related courses

Course

Course
Course
