easy solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nfunction queensAttacktheKing(queens: number[][], king: number[]): number[][] {\n  const result: number[][] = [];\n  const findTheQueens = ( direction: number[]) => {\n    let [x, y] = king;\n    while (x >= 0 && x < 8 && y >= 0 && y < 8) {\n      x += direction[0];\n      y += direction[1];\n      if (queens.some(quinn => quinn[0] === x && quinn[1] === y)) {\n        result.push([x, y]);\n        break;\n      }\n    }\n  };\n  for (let i = -1; i <= 1; i++) {\n    for (let j = -1; j <= 1; j++) {\n      if (i !== 0 || j !== 0) {\n        findTheQueens([i,j]); //from king move 8 directions to find the queens\n      }\n    }\n  }\n  return result;\n};\n```
['TypeScript']