There is a bi-directional graph with n vertices labeled 0 to n - 1. The edges are given as a 2D array edges, where edges[i] = [u, v] joins u and v. Every pair of vertices is joined by at most one edge and no vertex has an edge to itself. Return true if there is a valid path from source to destination, otherwise false.
There is a bi-directional graph with n vertices labeled 0 to n - 1. The edges are given as a 2D array edges, where edges[i] = [u, v] joins u and v. Every pair of vertices is joined by at most one edge and no vertex has an edge to itself. Return true if there is a valid path from source to destination, otherwise false.