Fix the figures.

Polish the chapter of data structure.
This commit is contained in:
krahets
2023-08-13 19:32:11 +08:00
parent ec82be7dc2
commit 0c18198c01
14 changed files with 79 additions and 73 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
!!! question
给定 $n$ 种硬币,第 $i$ 硬币的面值为 $coins[i - 1]$ ,目标金额为 $amt$ ,每种硬币可以重复选取,问能够凑出目标金额的最少硬币个数。如果无法凑出目标金额则返回 $-1$ 。
给定 $n$ 种硬币,第 $i$ 硬币的面值为 $coins[i - 1]$ ,目标金额为 $amt$ ,每种硬币可以重复选取,问能够凑出目标金额的最少硬币个数。如果无法凑出目标金额则返回 $-1$ 。
这道题的贪心策略在生活中很常见:给定目标金额,**我们贪心地选择不大于且最接近它的硬币**,不断循环该步骤,直至凑出目标金额为止。