結果 : explain dynamic programming approach for the algorithm