leetcode:Dynamic Programming solution