Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
6-liner: sum and check solution in Clear category for Can Balance by przemyslaw.daniel
def can_balance(data):
for pos in range(len(data)):
if not sum(value*(pos-index) for
index, value in enumerate(data)):
return pos
return -1
Dec. 13, 2018
Comments: