4 ms·
The author could easily base calculations off of cost(100; 1, 2, 5, 20, 40) and multiply the result by 5 to find the new optimal coin. This avoids unduly weight
by uiri 9y ago
The author could easily base calculations off of cost(100; 1, 2, 5, 20, 40) and multiply the result by 5 to find the new optimal coin. This avoids unduly weighting values which are impossible without a penny which is what cost(500; 5, 10, 25, 100, 200) would do.