Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Finding missing numbers in a list

by Aristotle (Chancellor)
on Sep 03, 2004 at 15:50 UTC ( #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
Node Status?
node history
Node Type: note [id://388318]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2020-09-26 16:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (141 votes). Check out past polls.

    Notices?