in reply to Finding missing numbers in a list
You can do it with the .. operator:
@a = (41888, 41889, 41890, 41892, 41895); @m = map $a[$_-1]+1..$a[$_]-1, 1..@a-1; print join(" ", @m), $/;
In Section
Seekers of Perl Wisdom
in reply to Finding missing numbers in a list
You can do it with the .. operator:
@a = (41888, 41889, 41890, 41892, 41895); @m = map $a[$_-1]+1..$a[$_]-1, 1..@a-1; print join(" ", @m), $/;