update 0377.组合总和Ⅳ :添加复杂度分析

This commit is contained in:
Yuhao Ju
2023-04-11 11:20:07 +08:00
committed by GitHub
parent f701133a9a
commit 6e62049cd3

View File

@ -130,6 +130,11 @@ public:
```
* 时间复杂度: O(target * n),其中 n 为 nums 的长度
* 空间复杂度: O(target)
C++测试用例有两个数相加超过int的数据所以需要在if里加上dp[i] < INT_MAX - dp[i - num]。
但java就不用考虑这个限制java里的int也是四个字节吧也有可能leetcode后台对不同语言的测试数据不一样