Jane Street interview question

Graph based problem involving non-graph input and basic data structure analysis