dynamic programming for minimum number of coins