maxProfit = function(prices, fee) {
  let len = prices.length
  let has = -prices[0]-fee
  let notHas = 0

  for(let i=1;i<len;i++){
    has = Math.max(has, notHas-prices[i]-fee)
    notHas = Math.max(notHas,has+prices[i])
  }
  return notHas
 }
@param {number[]} prices
@param {number} fee
@return {number}