Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Can Balance by _Chico_
from typing import Iterable
def can_balance(weights: Iterable) -> int:
p = sum(i*w for i, w in enumerate(weights)) / sum(weights)
return int(p) if int(p) == p else -1
June 6, 2021