Elementum Interview Question

A graph traversal problem.