Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Finding missing numbers in a list

by sleepingsquirrel (Hermit)
on Sep 03, 2004 at 16:35 UTC ( #388338=note: print w/replies, xml ) Need Help??


in reply to Finding missing numbers in a list

Not exactly the model of efficiency...
my @list = ( 41888, 41889, 41890, 41892, 41895 ); my @missing = grep { my $x=$_; not grep $x==$_, @list } $list[0]..$lis +t[$#list]; print "@missing\n";


-- All code is 100% tested and functional unless otherwise noted.

Log In?
Username:
Password:

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

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










    Results (141 votes). Check out past polls.

    Notices?