I try to learn map and group\_by but it's difficult...

My array of arrays :

```
a = [ [1, 0, "a", "b"], [1, 1, "c", "d"], [2, 0, "e", "f"], [3, 1, "g", "h"] ]

```

Expected result :

```
b= {
     1=> {0=>["a", "b"], 1=>["c", "d"]} , 
     2=> {0=>["e", "f"]} , 
     3=> {1=>["g", "h"]}
   }

```

Group by the `first value`, the second value can just be `0` or `1`.

A starting :

```
a.group_by{ |e| e.shift}.map { |k, v| {k=>v.group_by{ |e| e.shift}} }

=> [{1=>{0=>[["a", "b"]], 1=>[["c", "d"]]}},
   {2=>{0=>[["e", "f"]]}}, {3=>{1=>[["g", "h"]]}}]

```

I want to get "a" and "b" with the 2 first values, it's the only solution that I've found... (using a hash of hash)