mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-10 04:06:51 +08:00
update 0377.组合总和Ⅳ :添加复杂度分析
This commit is contained in:
@ -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后台对不同语言的测试数据不一样。
|
||||
|
Reference in New Issue
Block a user