Lesson 7 - MaxProfit (from scratch)