Skip to content

Commit df6b3a1

Browse files
authored
Update 575.distribute-candies.md
1 parent 8d2f859 commit df6b3a1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

problems/575.distribute-candies.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The number in given array is in range [-100,000, 100,000].
2525

2626
## 前置知识
2727

28-
- 数组
28+
- [数组](https://github.com/azl397985856/leetcode/blob/master/thinkings/basic-data-structure.md)
2929

3030
## 思路
3131
由于糖果是偶数,并且我们只需要做到两个人糖果数量一样即可。
@@ -73,3 +73,14 @@ class Solution:
7373
def distributeCandies(self, candies: List[int]) -> int:
7474
return min(len(set(candies)), len(candies) >> 1)
7575
```
76+
77+
**复杂度分析**
78+
- 时间复杂度:$O(N)$
79+
- 空间复杂度:$O(N)$
80+
81+
更多题解可以访问我的LeetCode题解仓库:https://github.com/azl397985856/leetcode 。 目前已经35K star啦。
82+
83+
关注公众号力扣加加,努力用清晰直白的语言还原解题思路,并且有大量图解,手把手教你识别套路,高效刷题。
84+
85+
86+
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gfcuzagjalj30p00dwabs.jpg)

0 commit comments

Comments
 (0)