Добавить
Уведомления

Longest Consecutive Sequence | Leetcode | Medium | Java | O(n)

This is a medium level problem which can be solved even by sorting ( time complexity: O(nlog(n)) ) but this video explains an algorithm to solve this problem in a better time complexity i.e. O(n) by making use of Set data structure. Link to the problem: https://leetcode.com/problems/longest-consecutive-sequence

Иконка канала Java Бест Практики
2 подписчика
12+
14 просмотров
2 года назад
5 декабря 2023 г.
12+
14 просмотров
2 года назад
5 декабря 2023 г.

This is a medium level problem which can be solved even by sorting ( time complexity: O(nlog(n)) ) but this video explains an algorithm to solve this problem in a better time complexity i.e. O(n) by making use of Set data structure. Link to the problem: https://leetcode.com/problems/longest-consecutive-sequence

, чтобы оставлять комментарии