We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
deffind_numbers(n,k):s=sorted(list(range(1,k+1)))foriinrange(2,n+1):temp=""j=1whilelen(temp)<k:num=i*jtemp+=str(num)j+=1temp_digits=sorted(map(int,temp))iftemp_digits==sandlen(set(temp_digits))==k:print(i)# Example usagea=list(map(int,input().split()))n,k=a[0],a[1]find_numbers(n,k)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #38: Pandigital multiples
You are viewing a single comment's thread. Return to all comments →
python 3