BFS
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```csharp []\npublic class Solution {\n    public int MinMalwareSpread(int[][] graph, int[] initial) {\n        int len = graph.Length;\n        List<int>[] arr = new List<int>[len];\n        for(int i = 0; i < len; i++)\n        {\n            arr[i] = new List<int>();\n            for(int j = 0; j < len; j++)\n            {\n                if(i != j && graph[i][j] == 1)\n                    arr[i].Add(j);\n            }\n        }\n\n        Array.Sort(initial);\n        int minInfect = int.MaxValue;\n\n        int res = 0;\n        int initM = initial.Length;\n        \n        foreach(int i in initial)\n        {\n            int finalNode = 0;\n            HashSet<int> visited = new();\n            Queue<int> que = new();\n\n            foreach(int node in initial)\n            {\n                if(node != i && visited.Add(node))\n                {\n                    que.Enqueue(node);\n                }\n            }\n\n            while(que.Count > 0)\n            {\n                int curNode = que.Dequeue();\n                for(int p = 0; p < arr[curNode].Count; p++)\n                {\n                    int edge = arr[curNode][p];\n                    if(!visited.Contains(edge) && i != edge)\n                    {\n                        visited.Add(edge);\n                        que.Enqueue(edge);\n                        finalNode++;\n                    }\n                }\n            }\n\n            int curSum = initM+finalNode-1;\n            if(curSum < minInfect)\n            {\n                minInfect = curSum;\n                res = i;\n            }\n        }\n\n        return res;\n    }\n}\n```
['C#']