So, I have a list similar to the following:
({:name "yellowtail", :quantity 2} {:name "tuna", :quantity 1}
{:name "albacore", :quantity 1} {:quantity 1, :name "tuna"})
My goal is to search the list of map elements and find duplicate keys, if there are duplicates, and then increase the number. Therefore, in the list, I have two displayed tuna that appear. I want to remove one and just increase the number of the other. Thus, the result should be:
({:name "yellowtail", :quantity 2} {:name "tuna", :quantity 2}
{:name "albacore", :quantity 1} )
C: the amount of tuna increased to 2. I tried to use recur for this without success, I'm not sure that recur is a good direction to work with. Can someone point me in the right direction?
source
share