We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8488c30 commit a378a7aCopy full SHA for a378a7a
problems/219.contains-duplicate-ii.md
@@ -31,12 +31,14 @@ Output: false
31
32
由于题目没有对空间复杂度有求,用一个hashmap 存储已经访问过的数字即可,
33
每次访问都会看hashmap中是否有这个元素,有的话拿出索引进行比对,是否满足条件(相隔不大于k),如果满足返回true即可。
34
+## 公司
35
36
+- airbnb
37
+- palantir
38
39
## 关键点解析
40
-无
-
41
+- 空间换时间
42
43
## 代码
44
@@ -139,3 +141,14 @@ public:
139
141
}
140
142
};
143
```
144
+
145
+**复杂度分析**
146
+- 时间复杂度:$O(N)$
147
+- 空间复杂度:$O(N)$
148
149
+更多题解可以访问我的LeetCode题解仓库:https://github.com/azl397985856/leetcode 。 目前已经35K star啦。
150
151
+关注公众号力扣加加,努力用清晰直白的语言还原解题思路,并且有大量图解,手把手教你识别套路,高效刷题。
152
153
154
+
0 commit comments