Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
simplified reduction solution in Clear category for How Much Gold by karlian
def checkio(alloys):
# gold = 1
# for alloy, prop in alloys.items():
# gold -= prop if "gold" in alloy else 1 - prop
# gold /= -2
# return gold
return (sum(prop if "gold" in alloy else 1 - prop for alloy, prop in alloys.items()) - 1) / 2
June 25, 2022
Comments: