Master Citadel's rigorous interview process with our comprehensive collection of advanced mathematics, algorithms, statistical modeling, and quantitative reasoning problems. Get hired at one of the world's most prestigious hedge funds and market makers.
Given a sequence of stock prices, find the maximum profit you can make with at most k transactions. You can only hold one share at a time.
Use dynamic programming with states (day, transactions_left, holding_stock). Time complexity: O(n*k), Space complexity: O(n*k)