in reply to comparing arrays
When this happens, I simply want to remove one copy of the pair and keep the other (remove one element from each array)
You don't explain which array the element should be removed from. In your example, you show one of a set of duplicates being removed from the first array and one from the other set of duplicates being removed from the other array. Could they always be removed from the same array? Do you wish to switch off and remove from first one, then the other, then the first, etc.?
Once you figure that out, it should be pretty easy to do. Hint: use a hash (or two if necessary.) The keys of a hash are unique.
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: comparing arrays
by Anonymous Monk on Dec 16, 2004 at 01:17 UTC | |
by sauoq (Abbot) on Dec 16, 2004 at 01:55 UTC | |
by Animator (Hermit) on Dec 16, 2004 at 15:16 UTC |