题目信息
原题链接:https://leetcode.com/problems/coin-change-ii/
原题描述
TODO:
输入输出示例
- Example 1
Input: s = "leetscode", dictionary = ["leet","code","leetcode"]
Output: 1
- Example 2
Input: s = "sayhelloworld", dictionary = ["hello","world"]
Output: 3
条件约束
- $$ 1 \leqslant s.length \leqslant 50 $$
- $$ 1 \leqslant dictionary.length \leqslant 50 $$
- $$ 1 \leqslant dictionary[i].length \leqslant 50 $$
dictionary[i]
和s
均只包含小写字母dictionary
中元素不重复
题解
分析
TODO
实现
TODO
代码比较长,可直接看 github
- 时间复杂度:$$ O(n) $$
- 空间复杂度:$$ O(n) $$