Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Sum positions solution in Clear category for Compass, Map and Spyglass by fed.kz
def navigation(plan):
def find_position(obj):
for x, row in enumerate(plan):
if obj in row:
return (x, row.index(obj))
def path(start, end):
return max(map(lambda x, y: abs(x - y), start, end))
return sum(path(find_position(first), find_position(second)) for first, second in zip('YYY', 'CMS'))
Nov. 6, 2018
Comments: