Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Direct solution in Clear category for The Brick Factory Problem by amandel
def crosses(k: int, s: int = None) -> int:
d = 1 if s else 4
s = s or k-2
return (k//2)*((k-1)//2)*(s//2)*((s-1)//2)//d
print("Example:")
print(crosses(6, 5))
# These "asserts" are used for self-checking
assert crosses(1, 1) == 0
assert crosses(5) == 1
assert crosses(5, 5) == 16
assert crosses(7) == 9
print("The mission is done! Click 'Check Solution' to earn rewards!")
Jan. 1, 2024
Comments: