Arithmetic progression question

Hello everyone,

I recently came across a problem that stated:

Given an sorted array of Arithmetic progression numbers there is only one number that is wrong. Find and return the position of the number that is not following the Arithmetic progression.
Ex. 1,3,5,6,9,11...etc should return 4.

I was able to find a brute force solution but was wondering if anyone has any better ideas.

Thank you in advance.

Comments (0)