What do the Bridges of Königsberg, a rail map and a social network share, and why does adding a weight to an edge change the question?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
Euler's model of Königsberg has four land masses as nodes and seven bridges as undirected edges, given as pairs in bridges. Count how many bridge ends touch each land mass (an edge adds one to each of its two nodes) and store the counts in a dictionary degree mapping each land-mass name to its count.