add a DP solution, accepted