Stock trading with fee
Your task
Given daily prices and a fixed transaction fee charged once per completed sell, find the maximum profit with unlimited transactions and at most one share held at a time. The fee is a non-negative integer. The price list may be empty.
Examples
stock_with_fee(prices: list[int], fee: int) -> intExample 1
Input
stock_with_fee([1, 3, 2, 8, 4, 9], 2)Output
8