I have the following list:
l = [
%{id: 1, name: "aash", possess: "car"},
%{id: 1, name: "aash", possess: "bike"},
%{id: 2, name: "rahul", possess: "scooter"}
]
I want to convert this into the following format:
ans = [
%{id: 1, name: "aash", possess: ["car", "bike"]},
%{id: 2, name: "rahul", possess: ["scooter"]}
]
Any idea on how to do this in elixir? Since all the variables are immutable, I don't know how to achieve the above transformation.