Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for The Square Chest by Moff
def square(r, c, s):
result = []
for i in range(s):
result.extend([[r * 4 + c + i + 1, r * 4 + c + i + 2],
[(r + s) * 4 + c + i + 1, (r + s) * 4 + c + i + 2],
[(r + i) * 4 + c + 1, (r + i + 1) * 4 + c + 1],
[(r + i) * 4 + c + s + 1, (r + i + 1) * 4 + c + s + 1]])
return result
def checkio(lines):
lines = [sorted(line) for line in lines]
return sum(1 for s in range(1, 4) for r in range(4 - s) for c in range(4 - s)
if all(line in lines for line in square(r, c, s)))
Aug. 3, 2015
Comments: