R
Random Qu
Hi All,
I have 2 hashes like this.
h1 = {
a1 => [y1, y2, y3],
a2 => [y4, y5, y6]
}
h2 = {
a2 => [z1, z2, z3],
a3 => [z4, z5, z6]
}
And I nedd to merge them into something like this.
h = {
a1 => [[y1, y2, y3] , []]
a2 => [[y4, y5, y6] , [z1, z2, z3]]
a3 => [[] , [z4, z5, z6]]
}
What's the best way of doing this?
Thanks a lot for your help!
- RQ
I have 2 hashes like this.
h1 = {
a1 => [y1, y2, y3],
a2 => [y4, y5, y6]
}
h2 = {
a2 => [z1, z2, z3],
a3 => [z4, z5, z6]
}
And I nedd to merge them into something like this.
h = {
a1 => [[y1, y2, y3] , []]
a2 => [[y4, y5, y6] , [z1, z2, z3]]
a3 => [[] , [z4, z5, z6]]
}
What's the best way of doing this?
Thanks a lot for your help!
- RQ