Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding
Ninjas X Naukri.com

Problem of the day

Given an array * ‘a’* of size

```
Input:
'a' = [1, 2, 4, 5], 'n' = 5
Output :
3
Explanation: 3 is the missing value in the range 1 to 5.
```

Detailed explanation

```
4
1 2 3
```

```
4
```

```
4 is the missing value in the range 1 to 4.
```

```
8
1 2 3 5 6 7 8
```

```
4
```

```
4 is the missing value in the range 1 to 8.
```

```
The expected time complexity is O(n).
```

```
1 <= 'n' <= 10^6
1 <= 'a'[i] <= 'n'
Time Limit: 1 sec
```