Find Missing Number
Given an array of positive numbers from 1 to n, such that all numbers from 1 to n are present except one, find the missing number.
Statement
Given an array of positive numbers from to , such that all numbers from to are present except one number, , find . The input array is not sorted.
Example
For example, for , let’s look at the below array, that is missing :
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.