MaxProfit Codility