modify stockII algorithm
refine stockIII algorithm