Created
July 17, 2021 22:40
-
-
Save ishikawa/3ee8e49292407f87ef026452f862d23c to your computer and use it in GitHub Desktop.
"The Art and Craft of Problem Solving" 1.1.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
combinations = set() | |
for x in range(1, 37): | |
for y in range(1, 37): | |
for z in range(1, 37): | |
if x * y * z == 36: | |
sisters = [x, y, z] | |
sisters.sort(reverse=True) | |
sisters = tuple(sisters) | |
if sisters not in combinations: | |
combinations.add(sisters) | |
print(f"{sisters[0]}\t{sisters[1]}\t{sisters[2]} = {sum(sisters)}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment