A dartboard has seven rings with respective scores of 11 points, 13 points, 31 points, 33 points, 42 points, 44 points, and 46 points.
More than one discharged dart may lodge in a given ring.
What is the minimum number of darts used to score 100? Show how its achievable.
Assuming that a total score of precisely 100 is the goal:
I can do it with 8 darts:
[11, 11, 13, 13, 13, 13, 13, 13]
----------------
scores = [11,13,31,33,42,44,46]
from itertools import combinations_with_replacement
goal = 100
for throws in range(2,10):
for comb in combinations_with_replacement(scores,throws):
if sum(comb) == goal:
print(sorted(list(comb)))
|
Posted by Larry
on 2023-03-27 09:17:56 |