(This problem is the same asMinimize Malware Spread, with the differences bolded.)
In a network of nodes, each nodeiis directly connected to another nodejif and only if graph[i][j] = 1.
Some nodesinitialare initially infected by malware. Whenever two nodes are directly connected and at least one of those two nodes is infected by malware, both nodes will be infected by malware. This spread of malware will continue until no more nodes can be infected in this manner.
SupposeM(initial) is the final number of nodes infected with malware in the entire network, after the spread of malware stops.
We will remove one node from the initial list, completely removing it and any connections from this node to any other node. Return the node that if removed, would minimize M(initial). If multiple nodes could be removed to minimizeM(initial), return such a node with the smallest index.