Best Time to Buy and Sell Stock II on LeetCode