new file:   maxProfit2.cpp