Missing Number

5

2 votes
Easy
Problem

Given an input 'n', you'll get first n natural numbers( i.e, from 1 to n) with one missing number. You've to find the missing number. For example, if you get input as 10, you'll get the below as input and here the missing number is 5.

Input : 10

1 6 4 9 2 3 10 8 7

Output : 5

Sample Input
10
1 6 4 9 2 3 10 8 7
Sample Output
5
Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?