# 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 $1$ to $n$, such that all numbers from $1$ to $n$ are present except one number, $x$, find $x$. The input array is not sorted.

## Example

For example, for $n = 7$, let’s look at the below array, that is missing $6$:

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