Java start from king's position and check 8 directions
\nclass Solution {\n    \n    int[][] directions = {{0,1}, {1,0}, {0,-1}, {-1,0}, {1,1}, {-1,-1}, {1,-1}, {-1,1}};\n    \n    public List<List<Integer>> queensA
```\nclass Solution {\n    \n    int[][] directions = {{0,1}, {1,0}, {0,-1}, {-1,0}, {1,1}, {-1,-1}, {1,-1}, {-1,1}};\n    \n    public List<List<Integer>> queensAttacktheKing(int[][] queens, int[] king) {\n        int[][] board = new int[8][8];\n        List<List<Integer>> res = new LinkedList<>();\n        \n        for(int[] queenPos : queens){\n            board[queenPos[0]][queenPos[1]] = 1;\n        }\n        \n        for(int[] direction : directions){\n            int row = king[0], col = king[1];\n            \n            while(row>=0 && row<8 && col>=0 && col<8 && board[row][col]==0){\n                row += direction[0];\n                col += direction[1];\n            }\n            \n            if(row>=0 && row<8 && col>=0 && col<8){\n                res.add(new LinkedList<>(Arrays.asList(new Integer[]{row, col})));\n            }\n        }\n        \n        return res;\n    }\n}\n```
['Java']