Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
What do we got in total? solution in Clear category for Can Balance by quarkov
def can_balance(weights):
for origin in range(1, len(weights)-1):
if not sum([weight * (origin-position) for position, weight in enumerate(weights)]):
return origin
return 0 if len(weights) == 1 else -1
Feb. 17, 2019
Comments: