Python (Simple DFS)
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```python3 []\nclass Solution:\n    def minMalwareSpread(self, graph, initial):\n        def function(del_node):\n            stack, visited = [i for i in initial if i != del_node], {i for i in initial if i != del_node}\n\n            while stack:\n                node = stack.pop()\n\n                for i in range(len(graph)):\n                    if graph[node][i] == 1 and i not in visited and i != del_node:\n                        stack.append(i)\n                        visited.add(i)\n\n            return len(visited)\n\n        ans = [[function(x),x] for x in initial]\n\n        ans.sort(key = lambda x: (x[0],x[1]))\n\n        return ans[0][1]\n```
['Python3']