Why is this brute force algorithm producing the incorrect result?
问题 I'm trying to write a brute-force algorithm that minimises the number of journeys of a herd of cows, subject to the conditions in the docstring. def brute_force_cow_transport(cows,limit=10): """ Finds the allocation of cows that minimizes the number of spaceship trips via brute force. The brute force algorithm should follow the following method: 1. Enumerate all possible ways that the cows can be divided into separate trips 2. Select the allocation that minimizes the number of trips without