# 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:**

```
**Input:** arr = [5,7,11,13]
**Output:** 9
**Explanation:** The previous array was [5,7,**9**,11,13].
```

**Example 2:**

```
**Input:** arr = [15,13,12]
**Output:** 14
**Explanation:** The previous array was [15,**14**,13,12].
```

**Constraints:**

* `3 <= arr.length <= 1000`
* `0 <= arr[i] <= 105`
* The given array is **guaranteed** to be a valid array.

## ac

```java
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jaywin.gitbook.io/leetcode/solutions/1228-missing-number-in-arithmetic-progression.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
