Meta Interview Question

Max profit on stock list