DSA
DSA copied to clipboard
Largest Arithmetic Subarray
A has an array of N non-negative integers. A wants to calculate maximum length of contiguous arithmetic subarray.
Arithmetic Subarray is an array that contains at least two integers and the difference between consecutive integers are equal. For example [9,10] , [3,3,3] and [9,7,5,3] arithmetic arrays.
Input: No. of test cases T integer no N array A[]