Given a directed graph of n nodes and m edges . What is the minimum number of edges that should be added to the graph so that from each node , it is possible to travel all the other nodes .
One of the approach to find the result was to count number of node that has indegree 0 in cnt1 and number of node that has outdegree 0 in cnt2 . Then the result is max(cnt1,cnt2) . But I couldn't understood this approach . Can someone explain it or provide any other approach to find the result .