Skip to content

Commit

Permalink
2023 day 6
Browse files Browse the repository at this point in the history
  • Loading branch information
taw10 committed Dec 7, 2023
1 parent 9fdef38 commit 9956021
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 2023/day06-wait-for-it/day06.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
racetimes = [40,82,84,92]
distrecords = [233,1011,1110,1487]

nwinning(racetime, distrecord) = count(x->x*racetime-x*x>distrecord, 0:racetime)
println("Part 1: ", prod(x->nwinning(x...), zip(racetimes, distrecords)))
println("Part 2: ", nwinning(40828492,233101111101487))

0 comments on commit 9956021

Please sign in to comment.