Simple Python Solution
\nclass Solution:\n    # Time: O(1)\n    # Space: O(1)\n    def queensAttacktheKing(self, queens: List[List[int]], king: List[int]) -> List[List[int]]:\n       
```\nclass Solution:\n    # Time: O(1)\n    # Space: O(1)\n    def queensAttacktheKing(self, queens: List[List[int]], king: List[int]) -> List[List[int]]:\n        queen_set = {(i, j) for i, j in queens}\n        res = []\n        \n        for dx, dy in [[0, 1], [1, 0], [-1, 0], [0, -1], [1, 1], [-1, 1], [1, -1], [-1, -1]]:\n            x, y = king[0], king[1]\n            while 0 <= x < 8 and 0 <= y < 8:\n                x += dx\n                y += dy\n                if (x, y) in queen_set:\n                    res.append([x, y])\n                    break\n        return res\n```
['Python', 'Python3']