More pythonic
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user