javascript 52ms
\n/**\n * @param {number[][]} queens\n * @param {number[]} king\n * @return {number[][]}\n */\nvar queensAttacktheKing = function(queens, king) {\n    \n    let
```\n/**\n * @param {number[][]} queens\n * @param {number[]} king\n * @return {number[][]}\n */\nvar queensAttacktheKing = function(queens, king) {\n    \n    let answer = [];\n    \n    traverse(king[0],king[1],-1,-1);\n    traverse(king[0],king[1],-1,0);\n    traverse(king[0],king[1],-1,1);\n    traverse(king[0],king[1],0,-1);\n    traverse(king[0],king[1],0,1);\n    traverse(king[0],king[1],1,-1);\n    traverse(king[0],king[1],1,0);\n    traverse(king[0],king[1],1,1);\n    \n    return answer;\n    \n    function traverse(currentX, currentY, x, y) {\n        if (currentX < 0 || currentY < 0 || currentX > 7 || currentY > 7)   return null;\n        for (let i = 0; i < queens.length; i++) {\n            if (currentX == queens[i][0] && currentY == queens[i][1])   {\n                answer.push([currentX,currentY])\n                return null;\n            }\n        }\n        traverse(currentX + x, currentY + y, x, y);\n    }\n};\n```
[]