DoorDash interview question

Easy stock trade problem