Longest Consecutive Sequence at Google
Medium47.0% acceptance
This problem has 75.0% frequency at Google.
Problem Description
Given an unsorted array of integers `nums`, return _the length of the longest consecutive elements sequence._ You must write an algorithm that runs in `O(n)` time.
Read full problem and hintsTopics
Also asked at 38 companies
More Google Questions
Two SumEasyLongest Substring Without Repeating CharactersMediumMedian of Two Sorted ArraysHardLongest Common PrefixEasyTrapping Rain WaterHard
View all Google questions