← Graph Exploration
Graph Exploration Target: 10s
Adjacency list is the standard graph representation. First step for BFS/DFS problems.
from collections import defaultdict graph = defaultdict(list) # or: {i: [] for i in range(n)}
Type it from memory. Go.