Java Easy to Understand Solution
\nclass Solution {\n    public List<List<Integer>> queensAttacktheKing(int[][] queens, int[] king) {\n        List<List<Integer>> result = new ArrayList();\n   
```\nclass Solution {\n    public List<List<Integer>> queensAttacktheKing(int[][] queens, int[] king) {\n        List<List<Integer>> result = new ArrayList();\n        int move[][] = {{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}};\n        \n        for(int i=0; i<8; i++) {\n            int x = king[0] + move[i][0];\n            int y = king[1] + move[i][1];\n            while(isValid(x, y)) {\n                if(queenExist(x, y, queens)) {\n                    result.add(Arrays.asList(x, y));\n                    break;\n                }\n                x += move[i][0];\n                y += move[i][1];\n            }\n        }\n        \n        return result;\n    }\n    \n    private boolean queenExist(int x, int y, int[][] queens) {\n        for(int i=0; i<queens.length; i++) {\n            if(queens[i][0] == x && queens[i][1] == y)\n                return true;\n        }\n        return false;\n    }\n    \n    private boolean isValid(int x, int y) {\n        return (x >= 0 && x < 8 && y >= 0 & y < 8) ? true : false;\n    }\n}\n```
[]