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).
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)
.Thanks! I then solved it thanks to this post
Advent of Code 2018 - Day 1
Christopher Kruse
exactly like you said. You can see my version here github.com/rhymes/aoc2018/blob/mas...