I have an array like
[
[358, 202102, 5],
[358, 202112, 5],
[358, 202102, 10],
[311, 202103, 5],
[311, 202101, 1],
[311, 202101, 1],
[311, 202115, 8],
[311, 202101, 1],
[311, 202101, 1]
]
I need a hash like this:
{
358 => {
202102 => 15,
202112 => 5
},
311 => {
202103 => 5,
202101 => 4,
202115 => 8
}
}
The order does not matter. Only the third values from each row of the array must be added up.
Arraystructure 100% guaranteed?a = [[358, 202102, 5],...]) readers can refer to those variables in their answers and comments without having to define them.