java - Dynamic Programming - making change - Stack Overflow

java - Dynamic Programming - making change - Stack Overflow

瀏覽:668
日期:2025-05-13
You don't need to switch to a greedy algorithm for solving the coin changing problem, you can solve it with a dynamic programming algorithm. For instance, like this: public int minChange(int[] denom, int targetAmount) { int actualAmount; int m = denom.len...看更多