Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for The Brick Factory Problem by mortonfox
def crosses(k: int, s: int = None) -> int:
return (k//2)*((k-1)//2)*((k-2)//2)*((k-3)//2)//4 if s is None else (k//2)*((k-1)//2)*(s//2)*((s-1)//2)
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. 10, 2024
Comments: