in reply to Re: Finding missing numbers in a list
in thread Finding missing numbers in a list
It isn't the easiest to understand, but that's very nice outside the box thinking!
Update: minor niggles: use $#a since that's what you mean — and please, please, use better variable names.
my @list = ( 41888, 41889, 41890, 41892, 41895 ); my @missing = map { ( $list[ $_ - 1 ] + 1 ) .. ( $list[ $_ ] - 1 ) } 1 + .. $#list;
Makeshifts last the longest.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Finding missing numbers in a list
by davorg (Chancellor) on Sep 02, 2016 at 10:01 UTC | |
by Anonymous Monk on Sep 02, 2016 at 11:13 UTC |
In Section
Seekers of Perl Wisdom