Leetcode - Longest Consecutive Sequence (Python)

preview_player
Показать описание
June 2021 Leetcode Challenge
Leetcode - Longest Consecutive Sequence #128
Difficulty: Medium
Рекомендации по теме
Комментарии
Автор

its o(n) but its space complexity sucks could you please help with that

gracemann
Автор

This is very helpful, Thanks! In the second last line, why are we subtracting start from n?

aly
Автор

may I know for HashSet solution why we use' if not in'' condition, why we can't use if 'n - 1 in nums'. Thanks

AdenGolden