Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: removing duplicated elements from array, with a difference

by Aristotle (Chancellor)
on Aug 28, 2002 at 19:45 UTC ( [id://193558]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my ($i, %seen) = (0);
    
    my @no_dup =
    ...
        @with_dup;
    
    @no_dup = map { 2 < @$_ ? $no_dup[$_->[0]] : () } values %seen;
    
  2. or download this
    my ($i, %seen) = (0);
    
    my @no_dup =
    ...
        @with_dup;
    
    @no_dup = @no_dup{grep $_ != -1, values %seen};
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-19 19:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found