1228. Missing Number In Arithmetic Progression
https://leetcode.com/problems/missing-number-in-arithmetic-progression
Description
In some array arr
, the values were in arithmetic progression: the values arr[i + 1] - arr[i]
are all equal for every 0 <= i < arr.length - 1
.
A value from arr
was removed that was not the first or last value in the array.
Given arr
, return the removed value.
Example 1:
Example 2:
Constraints:
3 <= arr.length <= 1000
0 <= arr[i] <= 105
The given array is guaranteed to be a valid array.
ac
Last updated