mirror of
				https://git.wolves.top/wolves/leetcode.git
				synced 2025-11-04 17:26:32 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			445 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			445 B
		
	
	
	
		
			C++
		
	
	
	
	
	
#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 |