Added Dp solution

(DP = Dynamic programing)