Company: Uber_all
Difficulty: medium
Academic Decathlon Problem Description Students are being selected for an academic decathlon team at a school. Each student has a skill level. A group of students is called a uniform team if, when the skill levels of its members are arranged in increasing order, the difference between every two consecutive skill levels is either 0 or 1 . You are given the skill levels of n students. Choose any group of them — the members do not have to be next to each other in the input — and report the maximum number of students a uniform team can contain. (inferred — a team is an arbitrary subset, not a contiguous stretch of the input: Example 1 picks 2 , 3 and 4 out of [4, 13, 2, 3] , which are not adjacent positions.) Input Format Read from standard input. n skills[0] skills[1] ... skills[n-1] The first line contains a single integer n , the number of students. Each of the next n lines contains a single integer, skills[i] , the skill level of student i (where 0 <= i < n ). O