Skip to content
RED SAG Skills
medium10 pts · first answer countshash-mapsets

Longest consecutive run in O(n)

For [100, 4, 200, 1, 3, 2], the longest run of consecutive integers is 1, 2, 3, 4. With a Set, which rule keeps the algorithm O(n)?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions