there bidirectional graph n vertex vertex label 0 n 1 inclusive the edge graph represent 2D integer array edge edgesi ui vi denote bidirectional edge vertex ui vertex vi every vertex pair connect edge vertex edge itselfyou want determine valid path exist vertex source vertex destinationgiven edge integer n source destination return true valid path source destination false Example 1input n 3 edge 011220 source 0 destination 2output trueexplanation there path vertex 0 vertex 2 0 1 2 0 2example 2input n 6 edge 0102355443 source 0 destination 5output falseexplanation there path vertex 0 vertex 5 Constraints1 n 2 1050 edgeslength 2 105edgesilength 20 ui vi n 1ui vi0 source destination n 1There duplicate edgesthere self edge