dp problem Stock Maximize