You are given an array of N elements.
Array elements have property :
adjacent elements of array differ by atmost '1'.
Now you have to find the maximum length segment in array such that this segment satisfies condition :
absolute difference between the maximum and minimum element of this segment should not be more than 1.
Input :
First line will contain an integer 'T' (number of test cases ).
For each test case there is an integer 'N' (number of elements in array).
On next line there will be N integers (array elements).
Output :
For each test case output the maximum length of required segment.
Constraint :
T <= 10
N <= 5*100000
1<=a[i] <= 1000000
Problem setter : Mohd Abdullah
Test case 1:
segment can be : [1,2] , [2,3]
Test case 2 :
segment : [5001,5000,5000,5001]
Test case 3 :
segment : [2,1,2]