mirror of
https://git.wolves.top/wolves/leetcode.git
synced 2025-11-04 17:26:32 +08:00
init
This commit is contained in:
25
23/10/Q1346.h
Normal file
25
23/10/Q1346.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef LEECODE_C_Q1346_H
|
||||
#define LEECODE_C_Q1346_H
|
||||
#include <map>
|
||||
using namespace std;
|
||||
|
||||
class Q1346 {
|
||||
public:
|
||||
bool checkIfExist(vector<int>& arr) {
|
||||
unordered_map<int,int> m;
|
||||
for(auto i:arr){
|
||||
m[i] = 1;
|
||||
}
|
||||
|
||||
for(auto [key,value]:m){
|
||||
if (m[key*2] == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
#endif LEECODE_C_Q1346_H
|
||||
Reference in New Issue
Block a user