JavaScript 100% fast, 100% space recursive solution.
It is easy to understand.\n```\nvar queensAttacktheKing = function(queens, king) {\n  let output = [];\n  let dirs = [[-1,0],[0,-1],[0,1],[1,0],[-1,-1],[-1,1],[
It is easy to understand.\n```\nvar queensAttacktheKing = function(queens, king) {\n  let output = [];\n  let dirs = [[-1,0],[0,-1],[0,1],[1,0],[-1,-1],[-1,1],[1,-1],[1,1]];\n\n  const check = (position, dir) => {\n    position[0] += dir[0];\n    position[1] += dir[1];\n    if (position[0] >= 0 && position[0] < 8 && position[1] >= 0 && position[1] < 8) {\n      const found = queens.find(q => q[0] === position[0] && q[1] === position[1]);\n      if (found) output.push(found);\n      else check(position, dir);\n    }\n  };\n\n  dirs.forEach(d => {\n    check([king[0],king[1]], d);  \n  });\n\n  return output;\n};
[]