Aggressive Cows problem

The problem statement is not clear. What is the significance of the array given as input

The problem is that
you need to maximize the minimum distance between any two cows.
The cows have to be placed in such a way that the minimum distance between the cows placed is maximum, and you need to print that maximized minimum distance as output.

The array given in input signifies the positions at which the cows can be placed.

Hint: Try to think of binary search

1 Like

Hey Harseerat,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.
Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.