Concept Flow - Aggressive Cows Maximum Minimum Distance
Sort stall positions
Set low = 0, high = max distance
While low <= high
Calculate mid = (low+high)//2
Check if cows can be placed with distance mid
Yes No
low=mid+1
Repeat until low > high
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.