I have two keyword lists
list 1:
[ j: [
u: [{:b, "a", 1}],
u: [ {:b, "b", 1}, {:b, "c", 1}, {:b, "d", 2} ] ]
]
list 2:
[ j: [
u: [{:b, "e", 1}],
u: [ {:b, "f", 1}, {:b, "g", 1}, {:b, "d", 2} ] ]
]
The final result should be the merge of these two lists. If any value in {:b, identifier, value} is greater than the corresponding value then it should be replaced. The final output should look like
[ j: [
u: [{:b, "a", 1}, {:b, "e", 1}],
u: [ {:b, "b", 1}, {:b, "c", 1}, {:b, "f", 1}, {:b, "g", 1}, {:b, "d", 2} ] ]
]
As you can see in list 1 and 2 {:b, “d”, value} identifier is “d” hence only the larger number will be merged
I have tried Keyword.merge
but didn’t helped much,
Thanks