Back to problems

Get Node To Remove

Algorithm · Salesforce · Hard

A network consists of g_nodes servers numbered from 1 to g_nodes and g_edges bidirectional links. The link with index i joins server g_from[i] with server g_to[i]. A binary array malware of length g_nodes indicates which servers are initially compromised: malware[i] = 1 means server (i+1) carries malware, while malware[i] = 0 means it is clean. The infection spreads in discrete steps: any clean server that shares a direct connection with an infected server becomes infected.…

Checking your access…