#T597. 最长平台

最长平台

Description

Given an array that has already been sorted in ascending order, a plateau in this array is defined as a sequence of consecutive elements with the same value, which cannot be extended further. For example, in the array 1, 2, 2, 3, 3, 3, 4, 5, 5, 6, the plateaus are 1, 2-2, 3-3-3, 4, 5-5, and 6. Write a program that takes an array as input and finds the longest plateau in it. In the example above, 3-3-3 is the longest plateau.

Input Format

The first line contains an integer n, representing the number of elements in the array. The second line contains n integers separated by spaces.

Output Format

Output the length of the longest plateau.

10
1 2 2 3 3 3 4 5 5 6
3
## Source

CodesOnline