<commit_before>// Time:  O(n)
// Space: O(n)

// Hash solution.
class Solution {
public:
    bool isReflected(vector<pair<int, int>>& points) {
        if (points.empty()) {
            return true;
        }
        unordered_map<int, unordered_set<int>> groups_by_y;
        int left = numeric_limits<int>::max();
        int right = numeric_limits<int>::min();
        for (const auto& p : points) {
            groups_by_y[p.second].emplace(p.first);
            left = min(left, p.first);
            right = max(right, p.first);
        }
        const auto mid = left + right;
        for (const auto& kvp : groups_by_y) {
            for (const auto& x : kvp.second) {
                if (x != mid - x && kvp.second.count(mid - x) == 0) {
                    return false;
                }
            }
        }
        return true;
    }
};
<commit_msg>Update line-reflection.cpp<commit_after>// Time:  O(n)
// Space: O(n)

// Hash solution.
class Solution {
public:
    bool isReflected(vector<pair<int, int>>& points) {
        if (points.empty()) {
            return true;
        }
        unordered_map<int, unordered_set<int>> groups_by_y;
        int left = numeric_limits<int>::max();
        int right = numeric_limits<int>::min();
        for (const auto& p : points) {
            groups_by_y[p.second].emplace(p.first);
            left = min(left, p.first);
            right = max(right, p.first);
        }
        const auto mid = left + right;
        for (const auto& kvp : groups_by_y) {
            for (const auto& x : kvp.second) {
                if (kvp.second.count(mid - x) == 0) {
                    return false;
                }
            }
        }
        return true;
    }
};

{'fraction_non_alphanumeric': 0.1372321945570353, 'fraction_numerical': 0.0011580775911986102, 'mean_word_length': 1.590704647676162, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2450174', 'n_tokens_mistral': 555, 'n_tokens_neox': 542, 'n_words': 128}