Find the missing element from an ordered array A[ ], consisting of N elements representing an Arithmetic Progression (AP) .
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow.
The first line of each test case contains an integer N, where N is the size of the array A[ ].
The second line of each test case contains N space separated integers of an Arithmetic Progression denoting elements of the array A[ ].
Note: The series should have a missing element in between a perfect A.P. with no missing element will not be considered.
Print out the missing element.
1 <= T <= 100
2 <= N <= 10
-50 <= A[i] <=50
2 10 14
-28 -21 -7 0
9 12 15 21 24
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.