I'm attempting to de-dupe an enormous email list migration, however there's a catch. I'd like to take the duplicates and turn them into their own array (3rd).
Lets make these arrays very simple, and short.
a = ["[email protected]", "[email protected]"]
b = ["[email protected]"]
Essentially i'm trying to make c = ["[email protected]"] because it's the only email that resides on both lists.
What I've attempted so far:
Is there an opposite to unqiq ?
ab = a + b
ab.uniq
returns: ["[email protected]", "[email protected]"]
Could I dump a + b into a third c array, and compare c to ab.uniq to get what's duplicated?
Am i missing an easier way to do this? Any help will be much appreciated!!!!