Find if Path Exists in Graph
Try to solve the Find if Path Exists in Graph problem.
We'll cover the following
Statement
Given a 2D list, edges
, which represents a bidirectional graph. Each vertex is labeled from
Determine whether a valid path exists from the source
vertex to the destination
vertex. If it exists, return TRUE; otherwise, return FALSE.
Constraints:
n
edges.length
edges[i].length
source
,destination
There are no duplicate edges.
There are no self-edges.
Examples
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.