Given daily stock prices and an integer k, you may complete at most k transactions (non-overlapping). Return the maximum profit. The input is JSON {prices, k}.
Input: JSON {prices, k}.
Output: Integer — the maximum profit.
Input: {"prices":[2,4,1],"k":2}
Output: 2
Explanation: One transaction profits 2.Input: {"prices":[3,2,6,5,0,3],"k":2}
Output: 7
Explanation: Two transactions profit 4 and 3.Input: {"prices":[1],"k":0}
Output: 0
Explanation: No transactions allowed.0<=k<=1001<=n<=1000