Let's say I have an array (NSArray) called arrayA -> {@"A", @"B", @"C", @"D", @"E"}
. And I have another array(NSArray) called arrayB -> {@"D", @"E", @"F", @"G", @"H"}
.
What's the most efficient way for me to get two arrays: 1. An array that is subset of both of them, so in this case it will be {@"D", @"E"} and a subset that is unique in arrayB, so {@"F", @"G", @"H"}.
It's easier if you look at this ven diagram: http://theconsigliori.com/blog/wp-content/uploads/2009/09/venn-diagram.jpg
A and B are arrays, I want to get 2 arrays, 1. A&B
2. B-(A&B).
I am using objective-c / cocoa-touch, but any general idea is welcome. The array are going to be approximately 6000 elements long and I am doing this on an iPad.
Thanks!