You are viewing a single comment's thread. Return to all comments →
Python 3
t = int(input().strip()) for a0 in range(t): n=int(input()) lst=[i for i in range(1,n+1)] k=1 for i in range(n): if lst[0]==1: del lst[0] if not len(lst): break num=lst[0] for j in range(len(lst)): if lst[j]%num==0: lst[j]=lst[j]//num k*=num print(k)
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #5: Smallest multiple
You are viewing a single comment's thread. Return to all comments →
My Solution