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

Problem

Submissions

Solution

Leaderboard

Coming soon

3

Difficulty: MEDIUM

Avg. time to solve

30 min

Success Rate

65%

Problem Statement

Suggest Edit

```
The first line of input contains the size of the array: N
The second line contains N single space-separated integers: A[i].
The third line of input contains the number of queries: Q
The next Q lines of input contain: the number which Harshit wants Aahad to search: Q[i]
```

```
For each test case, print the index of the number if found, otherwise -1.
Output for every test case will be printed in a separate line.
```

```
You are not required to explicitly print the expected output, just return it and printing has already been taken care of.
```

```
1 <= N <= 10^6
-10^9 <= A[i] <= 10^9
1 <= Q <= 500
-10^9 <= Q[i] <= 10^9
Time Limit: 1sec
```

```
4
2 5 -3 0
2
5
0
```

```
1
3
```

```
5
100 -2 6 10 11
2
100
6
```

```
0
2
```

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