Medium
Find the longest run of consecutive integers.
Return the length of the longest sequence of consecutive integers present in the array in overall linear time.
Examples
Input: nums = [100,4,200,1,3,2]
Output: 4
Constraints
- Values can be unsorted
Coding Challenge
Find the longest run of consecutive integers.
Return the length of the longest sequence of consecutive integers present in the array in overall linear time.
Input: nums = [100,4,200,1,3,2]
Output: 4
Preparing your coding workspace...