Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Finding missing numbers in a list

by saintmike (Vicar)
on Sep 03, 2004 at 17:55 UTC ( #388356=note: print w/replies, xml ) Need Help??


in reply to Finding missing numbers in a list

Set::IntSpan offers some nice features:
use Set::IntSpan; my $set = Set::IntSpan->new("41888, 41889, 41890, 41892, 41895"); $set = $set->complement()->intersect( Set::IntSpan->new($set->min . "-" . $set->max)); print $set->run_list(), "\n";
prints out
41891,41893-41894

Log In?
Username:
Password:

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

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










    Results (146 votes). Check out past polls.

    Notices?