pyassistant

Longest Consecutive Sequence

Given a list of integers, write a function to find the longest consecutive sequence of elements in the list. Return the length of the longest consecutive sequence.

Example:

Input:
[100, 4, 200, 1, 3, 2]
Output:
4

Make sure you return your solution, don't print!

AI

Bot

Trying to solve my challenge? Ask if you must, or press the purple button so I can analyze your code.