Hard
You are given an integer array nums where nums[i] is the price of a stock on day i, and an integer k. Return the maximum profit achievable with at most k transactions. You may not hold more than one share at a time.
Input: nums = [2,4,1], k = 2 Output: 2
Input: nums = [3,2,6,5,0,3], k = 2 Output: 7