LearnPy Hub
← Arena
IntermediateRating 1400

Longest Consecutive Sequence

Print the length of the longest set of consecutive integers that all appear in the array (order doesn't matter).

Input

n, then n integers.

Output

A length.

Sample 1

Input
6
100 4 200 1 3 2
Output
4

Sample 2

Input
1
7
Output
1
solution.py
Output appears here
Longest Consecutive Sequence · Python Arena problem · LearnPy Hub