Tap here to switch tabs
Problem
Submissions

Problem: Missing Number In Arithmetic Progression

Missing Number In Arithmetic Progression gives an array formed by removing one integer from an arithmetic progression. Return the missing value, with the first and last terms still present.

Statement

An integer array arr was originally an arithmetic progression of numbers, but exactly one integer was removed. The first and last elements of the original progression were never removed.

Return the missing integer.

Constraints:

  • 3≤3 \leq arr.length ≤1000\leq 1000

  • 0≤0 \leq arr[i] ≤105\leq 10^5

  • The given array is guaranteed to be a valid array.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Missing Number In Arithmetic Progression

Missing Number In Arithmetic Progression gives an array formed by removing one integer from an arithmetic progression. Return the missing value, with the first and last terms still present.

Statement

An integer array arr was originally an arithmetic progression of numbers, but exactly one integer was removed. The first and last elements of the original progression were never removed.

Return the missing integer.

Constraints:

  • 3≤3 \leq arr.length ≤1000\leq 1000

  • 0≤0 \leq arr[i] ≤105\leq 10^5

  • The given array is guaranteed to be a valid array.