C++ very easy solution
\n    int x_move[8]={-1,-1,0,1,1,1,0,-1};\n    int y_move[8]={0,1,1,1,0,-1,-1,-1};\n    \n    void check_attack(int pos, int chess[8][8], int x, int y, vector<v
```\n    int x_move[8]={-1,-1,0,1,1,1,0,-1};\n    int y_move[8]={0,1,1,1,0,-1,-1,-1};\n    \n    void check_attack(int pos, int chess[8][8], int x, int y, vector<vector<int>>&res){\n        while(x>=0 && x<8 && y>=0 && y<8){\n            if(chess[x][y]==1){\n                vector<int>v;\n                v.push_back(x);\n                v.push_back(y);\n                res.push_back(v);\n                return;\n            }\n            x+=x_move[pos];\n            y+=y_move[pos];\n        }\n    }\n    \n    vector<vector<int>> queensAttacktheKing(vector<vector<int>>& queens, vector<int>& king) {\n        vector<vector<int>>res;\n        int chess[8][8];\n        memset(chess,0,sizeof(chess));\n        for(int i=0;i<queens.size();i++)chess[queens[i][0]][queens[i][1]]++;\n        for(int i=0;i<8;i++)check_attack(i,chess,king[0],king[1],res);\n        return res;\n    }\n```
[]