Implement max profit with K transactions (DP) | Citadel Interview Question