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

Re^2: Algorithm for cancelling common factors between two lists of multiplicands

by ikegami (Pope)
on Aug 08, 2005 at 19:49 UTC ( #481993=note: print w/replies, xml ) Need Help??


in reply to Re: Algorithm for cancelling common factors between two lists of multiplicands
in thread Algorithm for cancelling common factors between two lists of multiplicands

This works whether the arrays contain duplicate elements or not:

my %a = map { $_ => 1 } @a; my %b = map { $_ => 1 } @b; @c = grep { !$b{$_} } @a; @d = grep { !$a{$_} } @b;
  • Comment on Re^2: Algorithm for cancelling common factors between two lists of multiplicands
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2019-10-14 00:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?