There is a network consisting of ‘n’ nodes. These ‘n’ nodes are connected using ‘n-1’ number of cables, to keep the entire network connected.
N = 6
Edges = [{2,3},{3,4},{4,5},{5,6},{1,5}]
Unfortunately, one of these nodes is infected by a malicious virus, which modifies the contents stored in a particular node, and to all nodes separated upto a distance ‘d’ from the corrupted source-node.
D = 3
You know information about some of the nodes which are corrupted. This is an array of size M.
M = 2.
Affected Nodes = [1,2]
There is exactly one node where the virus infestation would have taken place. Find all the possible nodes on which the virus infestation might have taken place. Assume input is such that the answer is always present.