AlgoMaster Logo

Best Time to Buy and Sell Stock with Transaction Fee

prices=[1, 3, 2, 8, 4, 9],fee=2
0 / 12
algomaster.io
Step:Start: stock prices = [1, 3, 2, 8, 4, 9], as many buy/sell pairs as you like, paying a fee of 2 on every sale