Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Finding missing numbers in a list

by Aristotle (Chancellor)
on Sep 03, 2004 at 15:50 UTC ( [id://388318]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @list = ( 41888, 41889, 41890, 41892, 41895 );
    
    ...
        delete @missing{ @list };
        keys %missing;
    };
    
  2. or download this
    my @missing;
    {
    ...
            push @missing, $_;
        }
    }
    
  3. or download this
    my @missing = do {
        my $i = 0;
        grep { $_ == $list[ $i ] ? ++$i && 0 : 1 } $list[ 0 ] .. $list[ -1
    + ];
    };
    

Log In?
Username:
Password:

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

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

    No recent polls found