Easy C++ DFS 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 {\npublic:\n    int minMalwareSpread(vector<vector<int>>& graph, vector<int>& initial) {\n        int n=graph.size();\n        sort(initial.begin(),initial.end());\n        vector<int> adj[n];\n        for(int i=0;i<n;i++){\n           for(int j=0;j<n;j++){\n               if(graph[i][j]==1){\n                   adj[i].push_back(j);\n               }\n           }\n        }\n        int mini=INT_MAX;\n        int ans=-1;\n        for(int i=0;i<initial.size();i++){\n            int cnt=0;\n            vector<int> vis(n,0);\n            queue<int> q;\n            for(int j=0;j<initial.size();j++){\n               if(j==i)continue;\n               else{\n                   cnt++;\n                   vis[initial[j]]=1;\n                   q.push(initial[j]);\n               }\n            }\n            while(!q.empty()){\n                int node=q.front();\n                q.pop();\n                for(auto nbr:adj[node]){\n                    if(!vis[nbr] && nbr!=initial[i]){\n                        q.push(nbr);\n                        cnt++;\n                        vis[nbr]=1;\n                    }\n                }\n            }\n            if(mini>cnt){\n                mini=cnt;\n                ans=initial[i];\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']