Coin change problem by dynamic programming