educative.io

Input adjacency list for the undirected graph

This is the input given in the question:
[[0,1],[1,2],[2,0],[2,1]]
So we have three vertices 0,1,2 and I am printing the graph using g.print_graph()
and this is what I see:

Adjacency List of Directed Graph<<
| 0 | => [ 2 ] → [ 1 ] → None
| 1 | => [ 2 ] → [ 2 ] → [ 0 ] → None
| 2 | => [ 1 ] → [ 0 ] → [ 1 ] → None
None
This does not look correct to me. How do I interpret input with what gets displayed by the print function


Course: Data Structures for Coding Interviews in Python - AI-Powered Learning for Developers
Lesson: Challenge: Count the Number of Edges in an Undirected Graph - Data Structures for Coding Interviews in Python