Skip to content

Instantly share code, notes, and snippets.

@ishikawa
Created July 17, 2021 22:40
Show Gist options
  • Save ishikawa/3ee8e49292407f87ef026452f862d23c to your computer and use it in GitHub Desktop.
Save ishikawa/3ee8e49292407f87ef026452f862d23c to your computer and use it in GitHub Desktop.
"The Art and Craft of Problem Solving" 1.1.3
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