零钱兑换

LeetCode Hot 100 动态规划
难度: 中等

题目描述

计算兑换金额的最少硬币数。

解题思路

使用动态规划,状态转移方程为 dp[i] = min(dp[i-coin] + 1),其中 coin 是硬币面值。时间复杂度为 O(amount * n)。