# Project Euler #32: Pandigital products

# Project Euler #32: Pandigital products

cnhnyu + 1 comment For N = 9, I got the following result:

4*1738=6952

4*1963=7852

12*483=5796

18*297=5346

27*198=5346

28*157=4396

39*186=7254

42*138=5796

48*159=7632

sum = 56370

I passed all tests except the last one. Can someone please tell me what's going wrong here?

cnhnyu + 1 comment Got it. No duplicate product. Not no duplicate multiplicand/multiplier pair.

bhavikgevariya + 0 comments [deleted]

deekshit_842 + 0 comments ive used brute force approach to solve this and got timeout in testcase 5 can anyone explain it

coder_batman + 0 comments what is the upper limit of the numbers to be considered for multiplicand and multiplier ?

rajesheeda1234 + 0 comments passed all the test cases

import re set1=set() sum=0 n=int(input()) for i in range(1964,1,-1): for j in range(100): if j not in set1: value=i*j str1=str(value)+str(i)+str(j) if value not in set1 : matcher=''.join(str(k) for k in range(1,n+1)) if(re.fullmatch(matcher,''.join(sorted(str1)))): sum=sum+value set1.add(value) print(sum)

tushartyagi8750 + 1 comment i am getting error for numbers greater than 7 i am using the permutation function.any help will be appericiated

prunns + 0 comments I used the same thing. At the beginning I was also getting wrong answers for TC 1,3 and 5. What kind of error are u getting?

I could pass all the cases with a little modification in pypy3 with the last case taking 1.21s

Sort 19 Discussions, By:

Please Login in order to post a comment