mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 12:58:42 +08:00
Fix the content
This commit is contained in:
@ -12,7 +12,7 @@ func coinChangeGreedy(coins []int, amt int) int {
|
||||
// 循环进行贪心选择,直到无剩余金额
|
||||
for amt > 0 {
|
||||
// 找到小于且最接近剩余金额的硬币
|
||||
for coins[i] > amt {
|
||||
for i > 0 && coins[i] > amt {
|
||||
i--
|
||||
}
|
||||
// 选择 coins[i]
|
||||
|
||||
Reference in New Issue
Block a user