Solve problem 347 and some reformatting.

This commit is contained in:
2024-06-23 12:27:16 -04:00
parent 75b4398c90
commit b889c12ae7
6 changed files with 50 additions and 13 deletions

View File

@@ -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)