Eulerian Path is a path in graph that visits every edge exactly once. Eulerian Circuit is an Eulerian Path which starts and ends on the same vertex. The task is to find that there exists the Euler Path or circuit or none in given undirected graph.
First line consists of test cases T. First line of every test case consists of 2 integers V and E, denoting the number of vertex and edges. Second line of every test case consists of 2*E spaced integers denoting the edge connected.
Return the int value to print 1 if Euler path exists print 2 if Euler cycle exists else 0.
1 0 0 2 2 1 0 3 3 4
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.