Skip to content

Instantly share code, notes, and snippets.

@igorvanloo
Created July 23, 2021 03:44
Show Gist options
  • Save igorvanloo/e36bb9938b8eaedbb1e08e312b0a3e6c to your computer and use it in GitHub Desktop.
Save igorvanloo/e36bb9938b8eaedbb1e08e312b0a3e6c to your computer and use it in GitHub Desktop.
Problem 32
def compute():
testlist = ['1', '2', '3', '4', '5', '6', '7', '8', '9']
values = set()
for x in range(9,99):
for y in range(99,999):
answer = x*y
if answer < 10000:
testingvalue = sorted(str(x) + str(y) + str(answer))
if testingvalue == testlist:
values.add(answer)
for x in range(1,9):
for y in range(999,9999):
answer = x*y
if answer < 10000:
testingvalue = sorted(str(x) + str(y) + str(answer))
if testingvalue == testlist:
values.add(answer)
return sum(values)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment