Comment
Comment by dnautics
this seems to be a syntax problem. The for loop is not really 'equivalent' in complexity to the functional solution. In Elixir, I'd do this:
But the presented functional solution throws more functions at it, which might look like this, which I think is quite clear.