You are viewing a single comment's thread. Return to all comments →
I don't understand why my code doesn't work?!
from collections import defaultdict d=defaultdict(lambda:[]) n,k=map(int,input().split(' ')) l=[] for i in range(1,n): temp=i*i*i s="".join(sorted(str(temp))) d[s].append(i) if len(d[s])==k: #d[s].sort() l.append(pow(min(d[s]),3)) #print(d) new=sorted(l) for v in new: print(v)
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #62: Cubic permutations
You are viewing a single comment's thread. Return to all comments →
I don't understand why my code doesn't work?!