Determine whether an undirected graph has a trail that uses every edge exactly once.
Constraints
Example
>>> has_eulerian_path(4, [(0,1),(1,2),(2,3),(3,0)]) True >>> has_eulerian_path(3, [(0,1),(1,2),(0,2)]) True >>> has_eulerian_path(3, [(0,1),(1,2)]) True >>> has_eulerian_path(0, []) True
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints