C++ unordered_set
\nstore queens coordinates in an unordered_set and find first match (if any) from king, in 8 directions.\n```\nclass Solution {\n      constexpr static int SIZE
\nstore queens coordinates in an unordered_set and find first match (if any) from king, in 8 directions.\n```\nclass Solution {\n      constexpr static int SIZE = 8;\n    \n   struct hasher {\n        size_t operator() (const pair<int,int>& coords)const {\n            return coords.first*8 + coords.second;\n        }\n    };\npublic:\n       vector<vector<int>> queensAttacktheKing( vector<vector<int>>& queens, const vector<int>& king) const{\n      unordered_set<pair<int,int>, hasher> queenZ;\n        for ( auto&& coords: queens) {\n            queenZ.insert( {coords[0], coords[1]});\n        }\n \n         vector<vector<int>> res;\n        constexpr array<int,8> col = {-1,1,0,0, 1,-1,1,-1};\n       constexpr  array<int,8> row = {0, 0,-1,1,1,-1,-1,1};\n        \n        for (auto idx = 0; idx < col.size(); ++idx) {\n            \n            auto x =  check(col[idx], row[idx], queenZ, king);\n            if (!x.empty())\n                res.push_back(move(x));\n        }\n        \n        return res;\n    }\n  \n     vector<int> check(const int cd,const  int rd, const unordered_set<pair<int,int>, hasher>  &queenZ , const vector<int>& king) const{\n         auto r = king[0];\n         auto c = king[1];\n         \n         while (0 <= r && r < SIZE &&  0 <= c && c < SIZE) {\n             if (queenZ.count({r, c}))\n                 return {r,c};\n             r += rd;\n             c += cd;\n                 \n                 \n         }\n         \n        return {};\n    }\n};
['C']