Added top-down DP solution