Problem 128 · Medium

Longest Consecutive Sequence

Put all numbers in a set; for each number that has no left neighbor, count the streak length.

Open the interactive visualisation