Given an integer array prices, where prices[i] represents the price of a stock on the i^{th} day, and an integer k, determine the maximum profit achievable by completing at most k transactions.
A transaction consists of buying the stock on one day and selling it on a later day.
Note: You cannot hold multiple stocks simultaneously. You must sell the current stock before buying again.
Constraints:
k
prices.length
prices[i]
Given an integer array prices, where prices[i] represents the price of a stock on the i^{th} day, and an integer k, determine the maximum profit achievable by completing at most k transactions.
A transaction consists of buying the stock on one day and selling it on a later day.
Note: You cannot hold multiple stocks simultaneously. You must sell the current stock before buying again.
Constraints:
k
prices.length
prices[i]