DFS || C++ || Easy to Understand || Well Named Variables
\n# Code\n\nclass Solution {\npublic:\n    int spreadMalware(int currNode,int removedNode,vector<bool>& visited,vector<vector<int>>& graph){\n        visited[cu
\n# Code\n```\nclass Solution {\npublic:\n    int spreadMalware(int currNode,int removedNode,vector<bool>& visited,vector<vector<int>>& graph){\n        visited[currNode]=true;\n        int infected=1;\n        for(int adjNode=0;adjNode<graph.size();adjNode++){\n            if(graph[currNode][adjNode]==1 && adjNode!=removedNode && !visited[adjNode]){\n                infected+=spreadMalware(adjNode,removedNode,visited,graph);\n            }\n        }\n        return infected;\n    }\n    int minMalwareSpread(vector<vector<int>>& graph, vector<int>& initial) {\n        int minInfected=INT_MAX;\n        int ansNode=0;\n        for(auto removedNode: initial){\n            int totalInfected=0;\n            vector<bool> visited(graph.size(),false);\n            for(auto infectedNode : initial){\n                if(removedNode!=infectedNode && !visited[infectedNode]) totalInfected+=spreadMalware(infectedNode,removedNode,visited,graph);\n            }\n            if(totalInfected<=minInfected){\n                if(totalInfected==minInfected){\n                    ansNode=min(ansNode,removedNode);\n                }\n                else ansNode=removedNode;\n                minInfected=totalInfected;\n            }\n        }\n        return ansNode;\n        \n    }\n};\n```
['Depth-First Search', 'C++']