#K85477. Longest Contiguous Subarray

    ID: 36650 Type: Default 1000ms 256MiB

Longest Contiguous Subarray

Longest Contiguous Subarray

You are given an array of integers. Your task is to determine the length of the longest contiguous subarray in which all elements are equal. Formally, for an array (A), you need to find the maximum integer (L) such that there exists an index (i) where (A[i] = A[i+1] = \dots = A[i+L-1]).

This is an input/output problem where you need to read data from standard input (stdin) and write your result to standard output (stdout).

inputFormat

The input starts with an integer (T) denoting the number of test cases. Each test case consists of two lines. The first line of a test case contains an integer (n), the size of the array. The second line contains (n) space-separated integers representing the elements of the array.

outputFormat

For each test case, output a single integer on a new line — the length of the longest contiguous subarray where all the elements are equal.## sample

1
4
1 2 2 3
2

</p>