Want to solve this problem? Login now to get access to solve the problems

Problem

Submissions

Solution

Leaderboard

Coming soon

103

Difficulty: EASY

Avg. time to solve

18 min

Success Rate

84%

Problem Statement

Suggest Edit

```
The first line of input contains a single integer T, representing the number of test cases or queries to be run.
Then the T test cases follow.
The first line of each test case contains a positive integer N which represents the length of the array.
The Second line of each test case contains N integers representing the elements of the array.
```

```
For each test case, return the minimum positive integer that is missing from the given input array.
```

```
You do not need to print anything. It has already been taken care of.
```

```
1 <= T <= 10
1 <= N <= 10^5
-10^5 <= arr[i] <= 10^5
Time Limit: 1 sec
```

```
1
5
3 2 -6 1 0
```

```
4
```

```
The first positive number is 1 and it is present in the array similarly 2 and 3 are also present in the array. 4 is missing from the array. Thus, the minimum positive integer that is missing is 4.
```

```
1
5
0 1 2 3 4
```

```
5
```

Want to solve this problem? Login now to get access to solve the problems