Dynamic Programming Approach Algorithm Steps