FromLeetcodeStatus回头复习下DateMay 28, 2024Tags哈希表Difficulty中等Linkhttps://leetcode.cn/problems/longest-consecutive-sequence/description/?envType=study-plan-v2&envId=top-100-liked题面给定一个未排序的整数数组 nums ,找出数字连续的最长序列(不要求序列元素在原数组中连续)的长度。请你设计并实现时间复杂度为 O(n) 的算法解决此问题。示例 1:示例 2:提示:0 <= nums.length <= 105109 <= nums[i] <= 109 思路 题解