1228. Missing Number In Arithmetic Progression

Problem

Find the missing number in an arithmetic progression array.

Given a sorted array arr that represents an arithmetic progression with a constant difference, where exactly one element is missing, find the missing element.

The array should have elements in arithmetic progression, but one is missing. Return the missing element.

Examples
Input: [5,7,11,13]
Output: 9
Hints
Related Problems

1228. Missing Number In Arithmetic Progression

Find the missing number in an arithmetic progression array.