this post was submitted on 06 Dec 2023
2 points (75.0% liked)

Advent of Code

285 readers
1 users here now

Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

https://adventofcode.com

founded 1 year ago
MODERATORS
top 2 comments
sorted by: hot top controversial new old
[โ€“] hal9001 1 points 11 months ago (1 children)

Ranges are always pesky. Lots of off by one errors when I was pulling this one together. It was also the first day I caved and broke out atoms

clojure solution

[โ€“] eskimofry 1 points 11 months ago

at first I was trying to extend my

Solution to problem 1


Which consists of passing a value to a funnel that is the vector whose elements are maps.

That would mean iterating one-by-one over seed ranges. Obviously this is too slow.

but then I deviated and started trying to redo the solution to problem 2 from scratch, at one point thinking about using a

spoilercustom tree based solution.

But my laziness won and I went back to my problem 1 solution and extended it there. Like you, faced off-by-one errors caused by not reading the problem statement properly.