[Java] Easy solution
java\nclass Solution {\n    public List<List<Integer>> queensAttacktheKing(final int[][] queens, final int[] king) {\n        final boolean[][] grid = new boole
```java\nclass Solution {\n    public List<List<Integer>> queensAttacktheKing(final int[][] queens, final int[] king) {\n        final boolean[][] grid = new boolean[8][8];\n\n        for(final int[] queen : queens)\n            grid[queen[0]][queen[1]] = true;\n\n        final int[][] directions = new int[][] { { 0, 1 }, { 1, 0 }, { 1, 1 }, { 0, -1 }, { -1, 0 }, { -1, -1 }, { -1, 1 }, { 1, -1 } };\n        final List<List<Integer>> result = new ArrayList();\n\n        for(final int[] direction : directions) {\n            int i = king[0], j = king[1];\n\n            while(i < 8 && j < 8 && i >= 0 && j >= 0) {\n                if(grid[i][j]) {\n                    result.add(List.of(i, j));\n                    break;\n                }\n\n                i += direction[0];\n                j += direction[1];\n            }\n        }\n\n        return result;\n    }\n}\n```
['Java']