We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The 4 2, per input format, means 4 nodes, and 2 edges, not and edge between the two nodes. The two edges are between 1 and 2, and 1 and 3. There is no edge between 2 and 4.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
BFS: Shortest Reach in a Graph
You are viewing a single comment's thread. Return to all comments →
The 4 2, per input format, means 4 nodes, and 2 edges, not and edge between the two nodes. The two edges are between 1 and 2, and 1 and 3. There is no edge between 2 and 4.