Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Friday, Dec 4.Claim the deal

(This question is a variation of the LeetCode question 128. Longest Consecutive Sequence. If you haven't completed that question yet, it is recommended to solve it first.)

A school wants to form the largest possible academic decathlon team from its students. You are given an integer array skills, where skills[i] is the skill level of one student.

Test Cases
Input
Output
Expected