You are on page 1of 1

10/16/23, 8:29 PM Aggressive Cows - Coding Ninjas

Interview Problem List Your EXP 425 


Topics Problem Subm g++ 5.4) Autocomplete settings
Note : 1 int aggressiveCows(vector<int> &stalls, int
2 {
You do not need 3 // Write your code here.
to print 4 }
anything; it has
already been
handled.

Sample Input 1 :

6 4
0 3 4 7 10 9

Sample Output 1 :

elosnoC
Explanation To Sample
Input 1 :

The maximum
possible minimum
distance between
any two cows will
be 3 when 4 cows
are placed at
positions {0, 3,
7, 10}. Here
distance between
cows are 3, 4 and
3 respectively.

Sample Input 2 :

5 2

  Run Submit   View hints

https://www.codingninjas.com/studio/problems/aggressive-cows_1082559 1/1

You might also like