DP solution to Unique path