Skip to content

Commit

Permalink
Add solution to 2023-12-06
Browse files Browse the repository at this point in the history
  • Loading branch information
fuglede committed Dec 6, 2023
1 parent f73fa32 commit fde22f7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 2023/day06/input
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Time: 46 68 98 66
Distance: 358 1054 1807 1080
13 changes: 13 additions & 0 deletions 2023/day06/solutions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import math

# Part 1
print(
math.prod(
sum(i * (limit - i) > dist for i in range(dist))
for limit, dist in zip([46, 68, 98, 66], [358, 1054, 1807, 1080])
)
)

# Part 2
limit, dist = 46689866, 358105418071080
print(sum(i * (limit - i) > dist for i in range(limit)))

0 comments on commit fde22f7

Please sign in to comment.