Java - 0 ms , faster than 100% , Easy to understand solution
The basic idea here is to move to all the 8 possible directions from king and see if any of the spot is occupied by a queen. If occupied then add that position 
The basic idea here is to move to all the 8 possible directions from king and see if any of the spot is occupied by a queen. If occupied then add that position to output and don\'t move in that direction since all other queens in that direction will be blocked by this queen.\n\n\n\n\n```\nclass Solution {\n    public List<List<Integer>> queensAttacktheKing(int[][] queens, int[] king) {\n        boolean[][] q = new boolean[8][8];\n\t\t//Mark all the positions of queen on a 8 X 8 board.\n        for (int[] queen: queens) {\n            q[queen[0]][queen[1]] = true;\n        }\n        List<List<Integer>> output = new ArrayList<>();\n\t\t//Specify all the moves of the queen\n        int[][] moves = {{-1,-1}, {0,-1}, {1,-1},{1,0}, {1,1}, {0,1}, {-1,1}, {-1,0}};\n        for(int i = 0; i < moves.length; i++){\n            int k = king[0] + moves[i][0];\n            int l = king[1] + moves[i][1];\n            while(k >= 0 && l >=0 && k < 8 && l < 8){\n                if(q[k][l]){\n                    List<Integer> pair = new ArrayList<>();\n                    pair.add(k);\n                    pair.add(l);\n                    output.add(pair);\n                    break;\n                }\n                k = k + moves[i][0];\n                l = l + moves[i][1];\n            }\n        }\n        \n        return output;\n    }\n}\n\n```
['Java']