def solve(): pandigital = set() for i in range(10000): for n in range(1, 10): product = ''.join(str(i * j) for j in range(1, n+1)) if isPandigital(product): pandigital.add(product) return max(pandigital)
def solve(): # use a set to ignore the same number pandigital = set() for i in range(2,100): s = 123 for j in range(s, 10000/i+1): num = str(i) + str(j) + str(i*j) if isPandigital(num): pandigital.add(i*j) return sum(pandigital)