AdventOfCode/2023/day6/part2.py

34 lines
615 B
Python
Raw Normal View History

2023-12-06 19:08:19 +01:00
#!/bin/python3
import sys
from pprint import pprint
import numpy as np
#time = 71530
#max_dist = 940200
# too lazy to write a parser
time = 60947882
max_dist = 475213810151650
total_winnings = 0
hold = 0
dist = 0
print('Time\tDist\tHold')
for j in range(1,time+1):
while time > 0:
print(time)
time -= 1
hold += 1
dist = hold * time
won = False
#print(str(time)+ '\t' + str(dist) + '\t' + str(hold) + '\t',end='')
if dist > max_dist:
total_winnings += 1
#print('won')
#else:
# print()
print(total_winnings)