New update is available. Click here to update.

Posted: 2 Mar, 2021

Difficulty: Easy

```
'K' must be less than or equal to the number of distinct elements in the given array.
Consider '0’ based indexing of the elements in the given array.
Print all indexes in increasing order.
```

```
If, 'ARR' = [4, 2, 4, 2, 1], and K = 2. Then output will be 0, 1, 2, 3.
```

```
The first line contains a single integer ‘T’ representing the number of test cases.
The first line of each test case will contain two space-separated integers ‘N’ and 'K' where ‘N’ is the length of the array, and 'K' is the integer which is described above.
The second line of each test case will contain ‘N’ space-separated integers which denote the elements in the given array.
```

```
For each test case, print the indexes of the first 'K' maximum elements in the increasing order.
Output for every test case will be printed in a separate line.
```

```
You don’t need to print anything; It has already been taken care of. Just implement the given function.
There is no need to sort the indexes in increasing order it has already been taken care of.
```

```
1 <= T <= 50
1 <= N <= 10000
1 <= K <= Distint Element in ARR
0 <= ARR[i] <= 10 ^ 5
Where 'ARR[i]' is the i'th element of the given 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: