Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: find the continuity in the data file

by repellent (Priest)
on Feb 05, 2012 at 02:50 UTC ( #951894=note: print w/replies, xml ) Need Help??


in reply to find the continuity in the data file

useSet::IntSpan::Fast;
my @n = qw(16 107 108 110 112 114 115 117 118 119 120 121 122 123 124 +125 127 128 130 132 133 135 136 138 142 146 149 150 154 156 157 158 1 +59 161 162); my $set = Set::IntSpan::Fast->new; $set->add(@n); print $set->as_string, "\n"; __END__ 16,107-108,110,112,114-115,117-125,127-128,130,132-133,135-136,138,142 +,146,149-150,154,156-159,161-162

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

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










    Results (129 votes). Check out past polls.

    Notices?