C# | Tuple
\n# Code\n\npublic class Solution {\n    public IList<IList<int>> QueensAttacktheKing(int[][] queens, int[] king) {\n        IList<IList<int>> result = new List
\n# Code\n```\npublic class Solution {\n    public IList<IList<int>> QueensAttacktheKing(int[][] queens, int[] king) {\n        IList<IList<int>> result = new List<IList<int>>();\n        HashSet<(int,int)> queensPosition = new();\n\n        foreach(int[] queen in queens)\n            queensPosition.Add((queen[0], queen[1]));\n\n        List<int[]> directions = new()  {    new int[]{-1,0}, new int[]{0,1 }, new int[]{1,0 },  new int[]{0,-1 },\n                                            new int[]{-1,1}, new int[]{1,1 }, new int[]{-1,-1 },  new int[]{1,-1 } \n                                        }; \n\n        foreach(var direction in directions)\n        {\n            int newX = king[0] + direction[0];\n            int newY = king[1] + direction[1];\n\n            while(newX >= 0 && newY >= 0 && newX < 8 && newY < 8)\n            {\n                if(queensPosition.Contains((newX,newY)))\n                {\n                    result.Add(new List<int>(){ newX, newY});\n                    break;\n                }\n                newX += direction[0];\n                newY += direction[1];\n            }\n\n        }\n        return result;\n    }\n}\n```
['C#']