![]() |
|
No such thing as a small change | |
PerlMonks |
Re: Mutually Exclusive Elementsby Zed_Lopez (Chaplain) |
on Dec 03, 2004 at 00:17 UTC ( #412005=note: print w/replies, xml ) | Need Help?? |
I'm not sure about your requirements. I wrote a solution that produces
This seems more consistent with your stated requirements than your example results. 4 & 8 are equally common -- they appear twice in the arrays. 4 occurs before 8 in $b, thus the elements appear in $b's order of insertion. At any rate, my algorithm was:
Updated: my unstated assumption in the above was that that code would be in a subroutine to be called like so:
In Section
Seekers of Perl Wisdom
|
|