Search⌘ K
AI Features

DIY: Longest Consecutive Sequence

Explore how to identify the length of the longest consecutive sequence within an unsorted array of integers. This lesson helps you implement an efficient solution in Swift, preparing you to solve similar coding interview problems involving sequence detection and array manipulation.

Problem statement

Given an unsorted array of integers, find the length of the longest consecutive elements sequence.

Input

The input will be an array of ...