Very easy 100 % CPP/ Graph
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```cpp []\n\nclass Solution {\npublic:\n    int minMalwareSpread(vector<vector<int>>& graph, vector<int>& initial) {\n        int n=graph.size();\n        vector<vector<int>> adj(graph.size());\n        for(int i=0;i<graph.size();i++){\n            for(int j=0;j<graph[0].size();j++){\n                if(i!=j && graph[i][j]){\n                    adj[i].push_back(j);\n                }\n            }\n        }\n\n        sort(initial.begin(), initial.end());\n\n        int min_infected=INT_MAX;\n        int ans=0;\n        vector<int> base(n,0);\n        for(auto &i:initial){\n            base[i]=1;\n        }\n\n        for(auto &i:initial){\n            vector<int> dp=base;\n            dp[i]=0;\n            vector<int> isvisited(n,false);\n            queue<int> Q;\n            for(auto &node:initial){\n                if(node!=i && isvisited[node]==false){\n                    Q.push(node);\n                    isvisited[node]=true;\n                }\n            }\n            while(!Q.empty()){\n                int node=Q.front();\n                Q.pop();\n                for(auto &edge:adj[node]){\n                    if(!isvisited[edge] && i!=edge){\n                        isvisited[edge]=true;\n                        Q.push(edge);\n                        dp[edge]=1;\n                    }\n                }\n            }\n            int s=accumulate(dp.begin(),dp.end(),0);\n            if(s<min_infected){\n                min_infected=s;\n                ans=i;\n            }\n        }\n\n\n        return ans;\n\n\n    }\n};\n```
['Array', 'Hash Table', 'Breadth-First Search', 'Graph', 'C++']