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.
a = list(map(int,input().split()))
n,k = a[0],a[1]
s = [i+1 for i in range(k)]
ans = []
for i in range(2,n+1):
temp = ""
j = 1
while len(temp)<=k :
if len(temp) == k:
temp = sorted([int(k) for k in temp])
if temp == s :
ans.append(i)
break
num = i*j
temp += str(num)
j += 1
ans.sort()
return ans
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
def result():