Limeade interview question

Stock buy/sell maximize profit algorithm question