Longest Special Path
Walk outward from every node, stopping as soon as a value repeats; a special path keeps the longest length, then the fewest nodes.
Walk outward from every node, stopping as soon as a value repeats; a special path keeps the longest length, then the fewest nodes.