[Python] Time O(n^3), DFS Solution
\nclass Solution:\n    def minMalwareSpread(self, graph: List[List[int]], initial: List[int]) -> int:\n        infections = [[] for _ in range(len(graph))]\n   
```\nclass Solution:\n    def minMalwareSpread(self, graph: List[List[int]], initial: List[int]) -> int:\n        infections = [[] for _ in range(len(graph))]\n        carriers = set(initial)        \n        \n        def infect(victim, carrier, visited):\n            infections[victim].append(carrier)\n            for i in range(len(graph)):\n                if graph[victim][i] and not i in carriers and not i in visited:\n                    visited.add(i)\n                    infect(i, carrier, visited)\n                \n        for i in initial:\n            visited = set([i])\n            infect(i, i, visited)\n        \n        count = collections.defaultdict(int)\n        for infection in infections:\n            if len(infection) == 1:\n                count[infection[0]] += 1\n        \n        max_size, max_carrier = 0, 0\n        for k, v in count.items():\n            if v > max_size or (v == max_size and k < max_carrier):\n                max_size, max_carrier = v, k\n        return max_carrier\n```
[]