I observed that some of the coin sets for coin change problem(getting minimum number of change coins for given amount) gives same solution with dp solution and greedy solution. I was wondering what is necessary and sufficient condition for getting optimal solution using greedy approach?