Dynamic Programming Approach Algorithm And Problem