🗓️Day 14
Sunday, 21 August 2022 - Day 14 of Exhort August 2022 - Exercism (My Elixir Journey)
Last updated
Sunday, 21 August 2022 - Day 14 of Exhort August 2022 - Exercism (My Elixir Journey)
Last updated
Boutique Inventory in Elixir on Exercism | View my solution
Oh Zeus. I really struggled with this one. And it was so simple. I don't know why. Here's my accepted solution:
I was trying all sorts of irrelevant things . I was also thrown off by the mention of Enum.into
in README.md
. I guess it was an alternative to Map.new
?
For total_quantity/1
, I used a different approach, while the exercise recommended Enum.reduce
. It was the purpose of the exercise to teach you that. My initial implementation was:
I think it's a little easier in the eyes, but I have no idea if it's slower as I am calling a Map
function and then an Enum
function. Whereas reduce/3
is one function.