More pythonic

This commit is contained in:
2026-04-18 15:31:40 +02:00
parent e6ed590b73
commit 605c9c7f7f

View File

@@ -29,11 +29,10 @@ def compute():
"""
ans = set()
pandigital = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
pandigital = [str(number) for number in range(1, 10)]
for x in range(1, 100):
for y in range(100, 10_000):
# product = x * y
if sorted(str(x) + str(y) + str(x * y)) == pandigital:
ans.add(x * y)