Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Ore In The Desert by Magu
from itertools import product
from math import hypot
def checkio(previous):
lst = []
for p in previous:
if not lst:
lst = [(x, y) for x, y in product(range(10), repeat=2) if round(hypot(p[0] - x, p[1] - y)) == p[2]]
else:
lst = [(x, y) for x, y in lst if round(hypot(p[0] - x, p[1] - y)) == p[2]]
return lst[0] if lst else [0, 0]
June 12, 2025