714 Best Time to Buy and Sell Stock with Transaction Fee
1. Question
Input:
prices = [1, 3, 2, 8, 4, 9], fee = 2
Output:
8
Explanation:
The maximum profit can be achieved by:
The total profit is ((8 - 1) - 2) + ((9 - 4) - 2) = 8.2. Implementation
3. Time & Space Complexity
Last updated