public boolean find(int target) {
        // iterate over entrySet instead of keySet to lower TLE errors
        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            int key = entry.getKey();
            int value = entry.getValue();
            int comp = target - key;
            if (map.containsKey(comp)) {
                if (comp != key) return true;
                else if (value >= 2) return true;
            }
        }
        return false;
    }