Coding

Aggressive Cows

Maximize the minimum distance between aggressive cows in stalls.

Input: stalls = [0,4,3,7,10,9], cows = 3

Output: 4

Explanation: Placing the cows at positions 0, 4, and 10 yields a maximum possible minimum distance of 4 between any two cows.

Was asked at

Practice this question with AI

First session is free - no credit card required.

Go Premium

More interviews, more skills, more success.

No answers yet

Be the first to share your approach to this question

Practice More Questions