Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
with items coordinates dictionary (so seaside traveled once) solution in Speedy category for Compass, Map and Spyglass by Phil15
def distance(A, B):
(xA, yA), (xB, yB) = A, B
return max(abs(xB-xA), abs(yB-yA))
def navigation(seaside):
coords = {elem: (i, j) for i, row in enumerate(seaside)
for j, elem in enumerate(row) if elem}
return sum(distance(coords['Y'], coords[item]) for item in 'CMS')
Sept. 5, 2018
Comments: