Skip to content

Commit 07ab5ce

Browse files
committed
Add leetcode 3250
1 parent 69d5e0c commit 07ab5ce

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

.idea/modules.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

leetcode/3250/Solution.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
class Solution {
2+
public:
3+
bool checkIfExist(vector<int>& arr) {
4+
map<int, bool> checker;
5+
for (int a : arr) {
6+
checker[a] = true;
7+
}
8+
bool zero = false;
9+
for (int a : arr) {
10+
if(a == 0 && !zero) {
11+
zero = true;
12+
continue;
13+
}
14+
if(checker[a * 2]) {
15+
return true;
16+
}
17+
}
18+
return false;
19+
}
20+
};

0 commit comments

Comments
 (0)