Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Code requested for array intersection count

by toma (Vicar)
on Jun 09, 2003 at 23:58 UTC ( [id://264493]=note: print w/replies, xml ) Need Help??


in reply to Code requested for array intersection count

Here's a forward-looking approach:
use Quantum::Superpositions; my @arr1= qw (two two three five four six six six seven); my @arr2= qw (one one three four bee seven eight six); my @intersection = eigenstates(any(@arr1) eq any(@arr2)); print "There are ",scalar(@intersection)," common elements\n"; print "Values: @intersection\n";
It should work perfectly the first time! - toma

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://264493]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-03-28 22:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found