#714 - Best Time to Buy and Sell Stock with Transaction Fee
Given an array prices where prices[i] is the stock price on day i, and an integer fee for each transaction (buy + sell = one transaction), find the maximum profit. You may complete as many transactions as you like, but you must sell before buying again.
| Input | Output |
|---|---|
prices = [1,3,2,8,4,9], fee = 2 | 8 |
prices = [1,3,7,5,10,3], fee = 3 | 6 |