You are given an array arr: the remaining terms, in their original order, of an integer arithmetic progression (a sequence with a constant difference between consecutive terms) after exactly one interior term was removed (never the first or last term).
Return the removed term.
The common difference may be negative or zero; when it is zero, every term is equal and the removed term equals them.
Input: arr = [3,7,11,19]
Output: 15
Explanation: The original progression was 3, 7, 11, 15, 19 with difference 4.
Input: arr = [10,7,1]
Output: 4
Explanation: The original progression was 10, 7, 4, 1 with difference -3.
Input: arr = [5,5,5]
Output: 5
Explanation: A constant progression, so the removed term equals every other term.
arr.length ≤105arr[i] ≤109arr was produced by deleting exactly one interior term from a valid integer arithmetic progression.