You’re given a network of n nodes as an n×n adjacency matrix graph with the ith node directly connected to the jth node if graph[i][j] == 1.
A list of nodes, initial, is given, which contains nodes initially infected by malware. When two nodes are connected directly and at least one of them is infected by malware, both nodes will be infected by malware. This spread of malware will continue until every node in the connected component of nodes has been infected.
After the infection has stopped spreading, M will represent the final number of nodes in the entire network that have been infected with malware.
Return a node from initial such that, when this node is removed from the graph, ...
You’re given a network of n nodes as an n×n adjacency matrix graph with the ith node directly connected to the jth node if graph[i][j] == 1.
A list of nodes, initial, is given, which contains nodes initially infected by malware. When two nodes are connected directly and at least one of them is infected by malware, both nodes will be infected by malware. This spread of malware will continue until every node in the connected component of nodes has been infected.
After the infection has stopped spreading, M will represent the final number of nodes in the entire network that have been infected with malware.
Return a node from initial such that, when this node is removed from the graph, ...