Challenge: Missing Number in Sorted Array

In this lesson, you will solve the challenge of calculating the missing number in a sorted array.

Missing number in sorted array

Suppose that you are given an array of contiguous integers starting from 1 to n, with one integer missing at any position in the array.

Have a look at the following illustration:

Case 1: An integer is missing

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.