C
Chris McMahon
Suppose I have an array of arrays like
[[A, B, C][1,2,3]]
I can easily make a hash (using each_with_index) where one value is
the lookup value for the other value:
1=>A
2=>B
3=>C
Now suppose I have a AoA like
[[A, B, C,][1,2,2]]
Is there a readable way to construct a hash like
1=>[A]
2=>[B, C]
?
Thanks,
-Chris
[[A, B, C][1,2,3]]
I can easily make a hash (using each_with_index) where one value is
the lookup value for the other value:
1=>A
2=>B
3=>C
Now suppose I have a AoA like
[[A, B, C,][1,2,2]]
Is there a readable way to construct a hash like
1=>[A]
2=>[B, C]
?
Thanks,
-Chris