In a network of nodes, a node can transmit a malware to other nodes and infect them. Find out the nodes who have started the malware transmission from the network traces.
Assumptions:
Network trace is like A->B, i.e. A transmitted malware to B
There are no cycles
Ex:
Network traces: [[1 -> 2 ], [1 -> 3], [2 -> 4], [2 -> 5], [6 -> 4]]
Ans: 1 and 6
the problem was simple, its just finding out the nodes with indegree 0.