#K56492. Longest Equal Subarray

    ID: 30210 Type: Default 1000ms 256MiB

Longest Equal Subarray

Longest Equal Subarray

You are given an array of integers. Your task is to determine the length of the longest contiguous subarray in which all the elements are equal. In other words, find the maximum number of consecutive identical numbers in the array.

The input consists of multiple test cases. For each test case, you will first receive an integer N denoting the size of the array, followed by N integers representing the array elements. Your solution should read from standard input (stdin) and write the answer for each test case to standard output (stdout).

Note: The array might be empty, in which case the answer is 0.

inputFormat

The first line of input contains an integer T indicating the number of test cases. Each test case consists of two lines:

  1. The first line contains an integer N denoting the number of elements in the array.
  2. The second line contains N space-separated integers representing the array.

outputFormat

For each test case, output a single line containing the length of the longest contiguous subarray where all elements are equal.

## sample
3
5
1 1 0 0 1
7
3 3 3 2 2 2 2
6
7 7 7 7 7 7
2

4 6

</p>