Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Explained variables solution in Clear category for Divide Gold by akamus
def captain_share(gold: int, sailors: int) -> int:
share = gold // (sailors + 2)
return 2 * share
print("Example:")
print(captain_share(15, 1))
# These "asserts" are used for self-checking
assert captain_share(15, 1) == 10
assert captain_share(28, 2) == 14
assert captain_share(54, 4) == 18
print("The mission is done! Click 'Check Solution' to earn rewards!")
July 29, 2024