Newcomer to Elixir, is this idiomatic code? (advent of code solution)

Agreed. Technically you do pattern match even in case statements, but yes, there’s a general preference for doing it in function heads (even anonymous function heads). I have run across a circumstance where I felt the code read better by using a case rather than splitting things up across multiple function heads, but I think that’s just an aesthetic one has to acquire with practice.