Coding
Longest Consecutive Sequence
Determine the length of the longest consecutive elements sequence.
Input: nums = [0,3,7,2,5,8,4,6,0,1]
Output: 9
Explanation: The longest consecutive sequence is 0 through 8 (length 9), utilizing a hash set to check connectivity in linear time.
Was asked at