Company: Rippling SDE_3april
Difficulty: medium
Malware Spread Control in a Network Problem Implement a prototype service for malware spread control in a network. There are g_nodes servers in a network and g_edges bidirectional connections between them. The i -th connection connects g_from[i] and g_to[i] . Some of the nodes are infected with malware. The array malware is 0-based and has length g_nodes : malware[i] = 1 means node i+1 is infected, and malware[i] = 0 means it is not. Graph node indices are 1-based. Any infected node infects all non-infected nodes that are directly connected to it. This process continues until no new infections can occur. You must remove exactly one node from the network. The removed node is deleted: it is not counted as infected, and infection cannot pass through it. You may remove any node (infected or clean). Return the index of the node to remove such that the total number of infected nodes in the remaining network after propagation is minimized. If multiple nodes lead to the same minimum result, re