Got first day puzzles done with [6b74a1]. Check out how slow my part 2 solution runs:
> (time (day01-part2)) cpu time: 959329 real time: 992959 gc time: 319283 69285
That’s about sixteen minutes of CPU time.
Other Racket solutions on reddit. Almost everyone else’s is more concise than mine: Here are some ways mine could be improved:
in-cycle
instead ofin-list
would completely remove the need for recursionfile->list
takes care of number conversion, unlikefile->lines
- Hash tables or sets would have been much faster for keeping track of the already-seen frequencies.