Java Easy Approach [beats 100% | Recursive ]. Code is talking for itself
class Solution {\n    public List<List<Integer>> queensAttacktheKing(int[][] queens, int[] king) {\n        int[][] board = new int[8][8];\n        List<List<In
```class Solution {\n    public List<List<Integer>> queensAttacktheKing(int[][] queens, int[] king) {\n        int[][] board = new int[8][8];\n        List<List<Integer>> ans = new ArrayList();\n    \n        for (int[] pos : queens) {\n            board[pos[0]][pos[1]] = 1;\n        }\n        \n        // There are 8 types of dirs\n        for (int i = 0; i < 8; i++) {\n            dfs(board, king[0], king[1], i, ans);\n        }\n        \n        return ans;        \n    }\n    \n    public void dfs(int[][] board, int row, int col, int dir, List<List<Integer>> ans) {\n        if (row < 0 || col < 0 || row >= 8 || col >= 8) \n            return;\n        if (board[row][col] == 1) {\n            List<Integer> pos = new ArrayList();\n            pos.add(row);\n            pos.add(col);\n            ans.add(pos);\n            return;\n        }\n        \n        switch (dir) {\n            case 0: \n                dfs(board, row-1, col, dir, ans);\n                break;\n            case 1: \n                dfs(board, row-1, col-1, dir, ans);\n                break;\n            case 2: \n                dfs(board, row, col-1, dir, ans);\n                break;\n            case 3: \n                dfs(board, row+1, col-1, dir, ans);\n                break;\n            case 4: \n                dfs(board, row+1, col, dir, ans);\n                break;\n            case 5: \n                dfs(board, row+1, col+1, dir, ans);\n                break;\n            case 6: \n                dfs(board, row, col+1, dir, ans);\n                break;\n            case 7: \n                dfs(board, row-1, col+1, dir, ans);\n                break;\n        }\n    }\n}```
[]