Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
zip -> sum -> set solution in Clear category for Escher Symmetry by igharok
def is_figure(data: list[int]) -> bool:
return len(set(map(sum, zip(data, data[::-1])))) == 1
print("Example:")
print(is_figure([1, 2, 1, 2]))
# These "asserts" are used for self-checking
assert is_figure([1, 2, 1, 2]) == True
assert is_figure([1, 3, 2, 1, 3]) == True
assert is_figure([1, 2, 2, 1]) == False
assert is_figure([4, 4, 4, 4, 4, 4, 4, 4, 4]) == True
print("The mission is done! Click 'Check Solution' to earn rewards!")
Oct. 18, 2024
Comments: