Dynamic Programming Vs Greedy Approach