Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Substantially 1line solution in Clear category for Delivery Drone by kazuki.h
from itertools import permutations, pairwise
def delivery_drone(orders):
return min(sum(abs(x-y) \
for x, y in pairwise(sum(perm, (0,)))) + perm[-1][1] \
for perm in permutations({(from_id, to_id) for from_id, to_id in enumerate(orders) if to_id}))
Dec. 28, 2021