Since I am learning ways to approach DP related problems, My approach always tends more towards greedy algorithm but, I see Greedy approach can not provide optimal solution for several test cases in lot of problems. So, How do you determine it's not suitable to use greedy approach for a given problem and go for dp only?