You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
In this problem 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.
For example:
Input: nums = [100, 4, 200, 1, 3, 2]
Output: 4
The longest consecutive sequence is [1, 2, 3, 4]. Therefore, its length is 4.
Input: nums = [0,3,7,2,5,8,4,6,0,1]
Output: 9
Constraints are:
0 <= nums.length <= 10^5
-10^9 <= nums[i] <= 10^9
Can yo please assign this problem to me @DevAffan
The text was updated successfully, but these errors were encountered:
In this problem 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.
For example:
Input: nums = [100, 4, 200, 1, 3, 2]
Output: 4
The longest consecutive sequence is [1, 2, 3, 4]. Therefore, its length is 4.
Input: nums = [0,3,7,2,5,8,4,6,0,1]
Output: 9
Constraints are:
0 <= nums.length <= 10^5
-10^9 <= nums[i] <= 10^9
Can yo please assign this problem to me @DevAffan
The text was updated successfully, but these errors were encountered: