You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given an undirected graph with n vertices and connections between them. Your task is to find whether you can come to same vertex X if you start from X by traversing all the vertices atleast once and use all the paths exactly once.
Example 1:
Input: paths = {{0,1,1,1,1},{1,0,-1,1,-1},
{1,-1,0,1,-1},{1,1,1,0,1},{1,-1,-1,1,0}}
Output: 1
Exaplanation: One can visit the vertices in
the following way:
1->3->4->5->1->4->2->1
Here all the vertices has been visited and all
paths are used exactly once.
The text was updated successfully, but these errors were encountered:
Given an undirected graph with n vertices and connections between them. Your task is to find whether you can come to same vertex X if you start from X by traversing all the vertices atleast once and use all the paths exactly once.
Example 1:
Input: paths = {{0,1,1,1,1},{1,0,-1,1,-1},
{1,-1,0,1,-1},{1,1,1,0,1},{1,-1,-1,1,0}}
Output: 1
Exaplanation: One can visit the vertices in
the following way:
1->3->4->5->1->4->2->1
Here all the vertices has been visited and all
paths are used exactly once.
The text was updated successfully, but these errors were encountered: