leetcode finish R; coursear algo design and analysis 2