Stalls stand at the positions in stalls (not sorted). You must place cows cows in different stalls so that the smallest distance between any two cows is as large as possible. Return that largest smallest distance.
Example 1
Input:
aggressive_cows([1, 2, 4, 8, 9], 3)
Output:
3
Cows at 1, 4 and 8 give a smallest distance of 3.
Example 2
Input:
aggressive_cows([10, 1, 2, 7, 5], 3)
Output:
4
Cows at 1, 5 and 10 give a smallest distance of 4.
2 <= cows <= len(stalls) <= 2 * 10**40 <= stalls[i] <= 10**9, and the positions are differentNo results yet
Run your code to check it against the examples, or submit to run every test.