Problem of the day
Input:
A = [1, 2, 4, 5], N = 5
Output :
3
Explanation: 3 is the missing value in the range 1 to 5.
First-line contains an integer ‘N’.
The second line has ‘N’-1 integers denoting the array ‘A’.
You must return the only missing integer from 1 to ‘N’.
You don’t need to print anything. Just implement the given function.
1 <= N <= 10^5
1 <= A[i] <= N
Time Limit: 1 sec
4
1 2 3
4
Input:
A = [1, 2, 3], N = 4
Output:
4
Explanation: 4 is the missing value in the range 1 to 4.
8
1 2 3 5 6 7 8
4