destcity-linear-time-and-space

Status: IN

destCity runs in O(n) time and O(n) space with two passes over the paths list: one to build the source set, one to find the non-source destination.

Source: entries/2026/06/06/destination-city-solution.md

JSON