MCPcopy Create free account
hub / github.com/algorithm004-01/algorithm004-01 / coinChange1

Method coinChange1

Week 03/id_006/LeetCode_322_006.java:20–38  ·  view source on GitHub ↗

分治、回溯角度思考:假设硬币为[10, 9, 1],兑换总额为18,那么问题可以转换为f(18) = min(f(18 - 10), f(18 - 9), f(18 - 1)) 直到硬币兑换成功 傻递归,leetcode 超时 @param coins @param amount @return

(int[] coins, int amount)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected