LeetCode Solutions/Arrays 101/Check If N and Its Double Exist/Check If N and Its Double Exist.java
class Solution {
    public boolean checkIfExist(int[] arr) {
        HashSet<Integer> set = new HashSet<>();
        for (int i : arr){
            if (set.contains(2*i) || (i%2 == 0 && set.contains(i/2))){
                return true;
            } 
            set.add(i);
        }
        return false;
    }
}