Concept Flow - Aggressive Cows Maximum Minimum Distance
Sort stall positions
Set low = 0, high = max distance
While low <= high
mid = (low+high)/2
Check if cows can be placed with min dist = mid
If yes
→low = mid + 1
If no
→high = mid - 1
Return high as max minimum distance
We sort stall positions, then use binary search on distance to find the largest minimum distance to place all cows.
