no recursion, simple queue solution
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```\nclass Solution:\n    def minMalwareSpread(self, graph: List[List[int]], initial: List[int]) -> int:\n        \n        n = len(graph)\n\n        def dfs(used,l):\n            \n            ans = 0\n            while len(l):\n                # print(ans, l, used)\n                a = l[0]\n                ans += 1\n                l.pop(0)\n                for i in range(n):\n                    # print(i,graph[a][i],used[a])\n\n                    if graph[a][i] == 1 and used[i] == 0:\n                        used[i] = 1\n                        l.append(i)\n            return ans\n        \n        ans = 500\n        tempmax = 500\n\n        for x in initial:\n            used = [0 for _ in range(n)]\n            used[x] = 1\n            temp = 0\n            for y in initial:\n                if used[y] == 0:\n                    l = [y]\n                    used[y] = 1\n                    temp += dfs(used,l)\n            # print(x,tempmax,temp)\n            if temp < tempmax:\n                tempmax = temp\n                ans = x\n            elif temp == tempmax:\n                ans = min(ans,x)\n        \n        return ans\n\n```
['Python3']