...

/

Longest Consecutive Sequence

Longest Consecutive Sequence

Try to solve the Longest Consecutive Sequence problem.

Statement

Given an unsorted array, nums, your task is to return the length of the longest consecutive sequence of elements. The consecutive sequence of elements is such that there are no missing elements in the sequence. The consecutive elements can be present anywhere in the input array.

Note: Two elements, ...

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy