Long a** solution but in 0ms
\nclass Solution {\npublic:\n    vector<vector<int>> queensAttacktheKing(vector<vector<int>>& queens, vector<int>& king) {\n        unordered_map<string,int> ma
```\nclass Solution {\npublic:\n    vector<vector<int>> queensAttacktheKing(vector<vector<int>>& queens, vector<int>& king) {\n        unordered_map<string,int> map;\n        vector<vector<int>> ans;\n        for(int i=0;i<queens.size();i++){\n            string s = to_string(queens[i][0]) + to_string(queens[i][1]);\n            map[s] = 1;\n        }\n        int ki = king[0], kj = king[1];\n        for(int i=ki-1;i>=0;i--) {\n            string str = to_string(i) + to_string(kj);\n            if(map.find(str)!=map.end()){\n                vector<int> v;\n                v.push_back(i);\n                v.push_back(kj);\n                ans.push_back(v);\n                break;\n            }\n        }\n        for(int i=ki+1;i<8;i++) {\n            string str = to_string(i) + to_string(kj);\n            if(map.find(str)!=map.end()){\n                vector<int> v;\n                v.push_back(i);\n                v.push_back(kj);\n                ans.push_back(v);\n                break;\n            }\n        }\n        for(int j=kj-1;j>=0;j--) {\n            string str = to_string(ki) + to_string(j);\n            if(map.find(str)!=map.end()){\n                vector<int> v;\n                v.push_back(ki);\n                v.push_back(j);\n                ans.push_back(v);\n                break;\n            }\n        }\n        for(int j=kj+1;j<8;j++) {\n            string str = to_string(ki) + to_string(j);\n            if(map.find(str)!=map.end()){\n                vector<int> v;\n                v.push_back(ki);\n                v.push_back(j);\n                ans.push_back(v);\n                break;\n            }\n        }\n        for(int i=ki+1,j=kj+1;i<8&&j<8;i++,j++){\n            string str = to_string(i) + to_string(j);\n            if(map.find(str)!=map.end()){\n                vector<int> v;\n                v.push_back(i);\n                v.push_back(j);\n                ans.push_back(v);\n                break;\n            }\n        }\n        for(int i=ki-1,j=kj-1;i>=0&&j>=0;i--,j--){\n            string str = to_string(i) + to_string(j);\n            if(map.find(str)!=map.end()){\n                vector<int> v;\n                v.push_back(i);\n                v.push_back(j);\n                ans.push_back(v);\n                break;\n            }\n        }\n        for(int i=ki-1,j=kj+1;i>=0&&j<8;i--,j++){\n            string str = to_string(i) + to_string(j);\n            if(map.find(str)!=map.end()){\n                vector<int> v;\n                v.push_back(i);\n                v.push_back(j);\n                ans.push_back(v);\n                break;\n            }\n        }\n        for(int i=ki+1,j=kj-1;i<8&&j>=0;i++,j--){\n            string str = to_string(i) + to_string(j);\n            if(map.find(str)!=map.end()){\n                vector<int> v;\n                v.push_back(i);\n                v.push_back(j);\n                ans.push_back(v);\n                break;\n            }\n        }\n            \n            \n        return ans;\n    }\n};\n```
[]