I have an array of arrays, like this:
aa = [ [a,d], [a,d1], [a,d], [b,d], [b,d2], [b,d3], [b,d2], [a,d2] ]
I would like to have a unique array of arrays, not just on the first element - which I can do by doing something like aa.uniq(&:first) - but rather remove the inner arrays if BOTH values match. So the result would be:
aa = [ [a,d], [a,d1], [a,d2], [b,d], [b,d2], [b,d3] ]
Can anyone assist in pointing me to an efficient way of doing this? I have large nr of arrays - in the order of 1 million - that I need to process.
Any help appreciated! John
aa.uniq(&:first)?