BFS: Shortest Reach in a Graph, is a HackerRank problem from Algorithms subdomain. In this post we will see how we can solve this challenge in Java

Problem Description

BFS: Shortest Reach Consider an undirected graph consisting of nodes where each node is labeled from to and the edge between any two nodes is always of length . We define node to be the starting position for a BFS. Given a graph, determine the distances from the start node to each of its descend ....

You can find the full details of the problem BFS - Shortest Reach in a Graph at HackerRank

Solution: Please check the snippet for the solution.

Solution originally posted at: Github by @Java-aid