I would like to find the most common elements within a column of arrays in presto.

For example...

```
    col1
    [A,B,C]
    [A,B]
    [A,D]

```

with output of...

```
    col1 - col2 
    A - 3
    B - 2
    C - 1
    D - 1    

```

I have tried using flatten and unnest. I am able to get it into a single array using

```
    select flatten(array_agg(col1))
    from tablename;

```

but I am then not sure how to group and count by the distinct elements. I also am struggling to get this to run on all of my data because of the large amount of memory required. 
Thanks for any help!