Didn’t find a thread for Advent of Code 2021. This year I thought I’d use it to kickstart learning Julia. I plan to solve the exercises in Elixir and Julia. Last year I didn’t make it through to the end, hopefully this year goes better.
Here’s my Julia solution for Day 1:
https://github.com/stevensonmt/advent_of_code/blob/ad011c614a2d35d54d41a8bdc3f1ee63b346a097/2021/day1/julia/day1.jl
I would appreciate any tips on improving my code both programatically and idiomatically for Julia. Also, if anyone can explain the use of @view
to generate the sliding window function I’d appreciate it. My intuitive understanding is that it could be written in Rust as something like
1..(length(processed) - window_size + step).iter()
.step_by(step)
.map(|i| processed[i..i+window_size])
.collect()