Rebased projecteuler folder, now includes all contest programming stuff

This commit is contained in:
2021-10-26 10:54:24 +02:00
parent 1aa6120838
commit e0c627a384
77 changed files with 203 additions and 67 deletions

38
projecteuler/005/main.py Normal file
View File

@@ -0,0 +1,38 @@
import os
import numpy
# Find the smallest number that is divisible by all numbers from 1 to 20
def isDivisible(n, ms):
res = True
for m in ms:
if n % m != 0:
res = False
break
return res
def findSmallestDivBy(ns):
res = 1
while not isDivisible(res, ns):
res = res + 1
return res
def main():
print("Hello, this is Patrick")
x = findSmallestDivBy([2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19])
print(x)
if __name__ == "__main__":
main()