Skip to content

Commit a378a7a

Browse files
authored
Update 219.contains-duplicate-ii.md
1 parent 8488c30 commit a378a7a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

problems/219.contains-duplicate-ii.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ Output: false
3131

3232
由于题目没有对空间复杂度有求,用一个hashmap 存储已经访问过的数字即可,
3333
每次访问都会看hashmap中是否有这个元素,有的话拿出索引进行比对,是否满足条件(相隔不大于k),如果满足返回true即可。
34+
## 公司
3435

36+
- airbnb
37+
- palantir
3538

3639
## 关键点解析
3740

38-
39-
41+
- 空间换时间
4042

4143
## 代码
4244

@@ -139,3 +141,14 @@ public:
139141
}
140142
};
141143
```
144+
145+
**复杂度分析**
146+
- 时间复杂度:$O(N)$
147+
- 空间复杂度:$O(N)$
148+
149+
更多题解可以访问我的LeetCode题解仓库:https://github.com/azl397985856/leetcode 。 目前已经35K star啦。
150+
151+
关注公众号力扣加加,努力用清晰直白的语言还原解题思路,并且有大量图解,手把手教你识别套路,高效刷题。
152+
153+
154+
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gfcuzagjalj30p00dwabs.jpg)

0 commit comments

Comments
 (0)