Solve problem 347 and some reformatting.
This commit is contained in:
@@ -17,12 +17,12 @@ def euler_205():
|
||||
all_combinations = len(scores_four) * len(scores_six)
|
||||
|
||||
four_won_count = 0
|
||||
for four_value, four_count in get_item_counts(scores_four).items():
|
||||
for four_value, four_count in get_item_counts(scores_four).items():
|
||||
current_six_count = 0
|
||||
for six_value, six_count in get_item_counts(scores_six).items():
|
||||
if four_value > six_value:
|
||||
current_six_count += six_count
|
||||
four_won_count += (four_count * current_six_count)
|
||||
four_won_count += four_count * current_six_count
|
||||
|
||||
p = four_won_count / all_combinations
|
||||
return f"{round(p, 7)}"
|
||||
@@ -32,4 +32,3 @@ if __name__ == "__main__":
|
||||
solution = euler_205()
|
||||
print("e205.py: " + str(solution))
|
||||
# assert(solution == 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user