New update is available. Click here to update.

Posted: 4 Dec, 2020

Difficulty: Moderate

```
1) The array may contain duplicate elements.
2) The size of the array is at least 2.
3) The given array follows 0-based indexing so 0 <= i,j< N.
4) It is guaranteed that there exist at least one such pair of indices.
```

```
The first line of the input contains an integer 'T' denoting the number of test cases.
The first line of each test case contains three space-separated integers 'N', 'K', and 'M', as described in the problem statement.
The second line of each test case contains 'N' space-separated integers, representing the elements of the array.
```

```
You just need to find the pair of indices(i and j), and if the pair returned satisfies the given condition, the output will be shown as “valid”, else the output will be shown as “invalid”.
```

```
You do not need to print anything, it has already been taken care of. Just implement the given function.
```

```
1 <= T <= 50
1 <= N <= 10^4
1 <= K <= N
1 <= M <= 10^9
1 <= ARR[i] <= 10^9
Where 'ARR[i]' denotes the 'ith' element of the array.
Time Limit: 1 sec
```

SIMILAR PROBLEMS

Best time to buy and sell stock

Posted: 2 Sep, 2022

Difficulty: Moderate

Best time to buy and sell stock II

Posted: 5 Sep, 2022

Difficulty: Moderate

Ninja And The Class Room

Posted: 19 Sep, 2022

Difficulty: Easy

Array Rotation

Posted: 21 Oct, 2022

Difficulty: Easy

Find The Single Element

Posted: 30 Oct, 2022

Difficulty: Easy

Categories:

Popular Courses: