re: AoC Day 1: Chronal Calibration VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Is it normal that part 2 is killing my CPU :D ? It's been running for minutes in Elixir but nada. Anyhow, I've tried day 1 with all three language...
 

On the Clojure pt 2, you're effectively running an endless loop. You always take the first element from the cycled number collection, so you'll never hit the exit condition.
To avoid this while using the approach you chose, add a third numbers binding to the loop, and pass (rest numbers) when recuring, while computing total using (first numbers).

 
code of conduct - report abuse