Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
itertools.combinations_with_replacement(iterable, r) solution in Clear category for Unfair Dice by David_Jones
from itertools import combinations_with_replacement, product
def winning_die(enemy_die):
for your_die in combinations_with_replacement(range(1,18), len(enemy_die)):
if (
sum(your_die) == sum(enemy_die)
and sum((x>y)-(x 0
):
return list(your_die)
return []
July 5, 2019
Comments: