New update is available. Click here to update.

Posted: 10 Jan, 2021

Difficulty: Moderate

```
In the below figure where array/list elements are {2, 1, 5, 6, 2, 3}.
```

```
A painter can paint blocks {5,6} or {1,5,6,2} together but not {2,5,6} or {5,6,3}.
```

```
The first line contains a single integer ‘T’ denoting the number of test cases.
The first line of each test case contains two integers ‘N’ and ‘K’ denoting the number of elements in the array/list and number of painters available.
The second line contains ‘N’ single space-separated integers denoting the elements of the array/list.
```

```
For each test case, print the minimum time required to get the job done.
```

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

```
1 <= T <= 5
1 <= N <= 10^4
1 <= K <= N
1 <= ARR[i] <= 10^5
Where ‘T’ is the number of test cases.
'N' is the length of the given array/list (boards).
‘K’ is the number of painters available.
And, ARR[i] denotes the i-th element in the array/list.
Time Limit: 1 sec.
```

SIMILAR PROBLEMS

NINJA AND HAPPINESS

Posted: 9 Sep, 2022

Difficulty: Hard

DECODE STRING

Posted: 11 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: