How can I complete the pandigital_products() method so that it sums all the products whose multiplicand/multiplier/product identity is writable as a
1 through n pandigital? pandigitalProducts(4) and pandigitalProducts(6) should return 12 and 162.
def is_pandigital(n):
mask = 0
i = 0
while n > 0:
mask |= 1 << (n % 10)
n //= 10
i += 1
return 2 + mask == 1 << (i + 1)
def pandigital_products(n):
pass```