Largest Plus Sign || C++, short and simple
\nclass Solution {\npublic:\n    int orderOfLargestPlusSign(int n, vector<vector<int>>& mines) {\n        vector<set<int>> rows(n, {-1, n});\n        vector<set
```\nclass Solution {\npublic:\n    int orderOfLargestPlusSign(int n, vector<vector<int>>& mines) {\n        vector<set<int>> rows(n, {-1, n});\n        vector<set<int>> cols(n, {-1, n});\n        \n        for(auto &p : mines) {\n            rows[p[1]].insert(p[0]);\n            cols[p[0]].insert(p[1]);\n        }\n        \n        int max_p = 0;\n        for(int r = 0; r < n; ++r) {\n            for(int c = 0; c < n; ++c) {\n                auto hl = rows[r].upper_bound(c);\n                auto hr = hl--;\n                int h = min(c - *hl, *hr - c);\n                \n                auto vl = cols[c].upper_bound(r);\n                auto vr = vl--;\n                int v = min(r - *vl, *vr - r);\n                \n                max_p = max(max_p, min(h, v));\n            }\n        }\n        \n        return max_p;\n    }\n};\n```
[]