Max profit3

Leetcode