Here's one way to do it:
hth,my @a=qw(1 2 3 4 6 3 1); my %h = map {$_=>1} @a; my ($max) = reverse sort keys %h; for (1..$max) { print "gap at $_ \n" unless exists $h{$_} }
In reply to Re: Check for sequential values in an array that can contain duplicate int values
by andye
in thread Check for sequential values in an array that can contain duplicate int values
by rehgb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |