easy c++ code faster than 100 percent
class Solution {\npublic:\n    vector> queensAttacktheKing(vector>& queens, vector& king) {\n        int chess[8][8]={0};\n        int i,j;\n        int n=queen
class Solution {\npublic:\n    vector<vector<int>> queensAttacktheKing(vector<vector<int>>& queens, vector<int>& king) {\n        int chess[8][8]={0};\n        int i,j;\n        int n=queens.size();\n        int x=king[0];\n        int y=king[1];\n        vector<vector<int>>res;\n        chess[x][y]=1;\n        for(i=0;i<n;i++)\n        {\n             x=queens[i][0];\n             y=queens[i][1];\n            chess[x][y]=2;\n        }\n         x=king[0];\n         y=king[1];\n        for(j=y;j<8;j++)\n        {\n            if(chess[x][j]==2)\n            {\n                res.push_back({x,j});\n                break;\n            }\n        }\n        for(j=y;j>=0;j--)\n        {\n            if(chess[x][j]==2)\n            {\n                res.push_back({x,j});\n                break;\n            }\n        }\n        for(i=x;i<8;i++)\n        {\n            if(chess[i][y]==2)\n            {\n                res.push_back({i,y});\n                break;\n            }\n        }\n        for(i=x;i>=0;i--)\n        {\n            if(chess[i][y]==2)\n            {\n                res.push_back({i,y});\n                break;\n            }\n        }\n        int tempx=x;\n        int tempy=y;\n        while(tempx<8&&tempy<8)\n        {\n            if(chess[tempx][tempy]==2)\n            {\n                res.push_back({tempx,tempy});\n                break;\n            }\n           \n                tempx++;\n                tempy++;\n            \n        }\n        tempx=x;\n        tempy=y;\n        while(tempx>=0&&tempy>=0)\n        {\n             if(chess[tempx][tempy]==2)\n            {\n                res.push_back({tempx,tempy});\n                break;\n            }\n           \n                tempx--;\n                tempy--;\n           \n        }\n        tempx=x;\n        tempy=y;\n        while(tempx>=0&&tempy<8)\n        {\n             if(chess[tempx][tempy]==2)\n            {\n                res.push_back({tempx,tempy});\n                break;\n            }\n           \n                tempx--;\n                tempy++;\n        }\n        tempx=x;\n        tempy=y;\n        while(tempx<8&&tempy>=0)\n        {\n             if(chess[tempx][tempy]==2)\n            {\n                res.push_back({tempx,tempy});\n                break;\n            }\n           \n                tempx++;\n                tempy--;\n        }\n        return res;\n        \n        \n        \n        \n    }\n};
[]