d06 part one and two

This commit is contained in:
Arthur 2023-12-06 10:26:40 +01:00
parent 8c13efe322
commit 4884b22b53
1 changed files with 15 additions and 0 deletions

15
d06/run.py Normal file
View File

@ -0,0 +1,15 @@
def main(races, S=1):
for t, d in races:
result = []
for h in range(0, t+1):
if (h * (t-h)) > d: result.append(h)
S *= len(result)
return S
if __name__ == '__main__':
races=[(7,9), (15,40), (30,200)]
races2=[(71530,940200)]
racesI=[(42,284), (68,1005), (69,1122), (85,1341)]
racesI2=[(42686985,284100511221341)]
print(main(racesI2))