Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Code requested for array intersection countby dvergin (Monsignor) |
on Jun 09, 2003 at 15:26 UTC ( [id://264354]=note: print w/replies, xml ) | Need Help?? |
As 3dan notes, this question has been asked and answered many times. But just for fun, here's a quick (tested) solution that takes a different approach from that of tcf22. This leaves a hash (%counts) with all the results available for later processing. (tcf22's approach could be adjusted to do that also.)
Which results in: A : 3 B : 2
------------------------------------------------------------
In Section
Seekers of Perl Wisdom
|
|