Dynamic programming+Array--Best Time to Buy and Sell Stock--leftMin