Shortest Path in Undirected Graph
Sep 7, 2025 · 4 min read · Problem You are given an adjacency list, adj of Undirected Graph having unit weight of the edges, find the shortest path from src to all the vertex and if it is unreachable to reach any vertex, then return -1 for that vertex. Examples : Input: adj[][...
Join discussion