Skip to content

Commit 66fb201

Browse files
committed
fix: docs
1 parent 006c72f commit 66fb201

File tree

1 file changed

+5
-1
lines changed
  • solution/3100-3199/3183.The Number of Ways to Make the Sum

1 file changed

+5
-1
lines changed

solution/3100-3199/3183.The Number of Ways to Make the Sum/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3100-3199/3183.Th
7878

7979
最后 $f[n]$ 就是使用硬币 $1, 2, 6$ 凑成金额 $n$ 的方案数,然后如果 $n \geq 4$,我们考虑选择一个硬币 $4$,那么方案数就是 $f[n] + f[n - 4]$,如果 $n \geq 8$,我们再考虑选择两个硬币 $4$,那么方案数就是 $f[n] + f[n - 4] + f[n - 8]$。
8080

81+
注意答案的取模操作。
82+
8183
时间复杂度 $O(n)$,空间复杂度 $O(n)$。其中 $n$ 是金额。
8284

8385
<!-- tabs:start -->
@@ -217,7 +219,9 @@ function numberOfWays(n: number): number {
217219
- 如果 $4 \leq n < 8$,返回 $f[n] + f[n - 4]$;
218220
- 如果 $n \geq 8$,返回 $f[n] + f[n - 4] + f[n - 8]$。
219221

220-
注意
222+
注意答案的取模操作。
223+
224+
时间复杂度 $O(n)$,空间复杂度 $O(n)$。其中 $n$ 是金额。
221225

222226
<!-- tabs:start -->
223227

0 commit comments

Comments
 (0)