Wayfair Interview Question

A Eulerian Tour-based question on Tree/Graph