- or download this
for my $i (0 .. $#digits) {
for my $j (0 .. $#digits) {
...
++$flag if $digit[$i] == $digit[$j];
}
}
- or download this
for my $i (0 .. $#digits) {
for my $j ($i + 1 .. $#digits) {
++$flag if $digits[$i] == $digits[$j];
}
}
- or download this
sub check_duplicates {
my $candidate = shift;
++$flag if $candidate =~ /(.).*\1/;
}
- or download this
sub check_prime {
my $candidate = shift;
++$flag if 2 != $candidate =~ tr/2357//;
}
- or download this
for (my $candidate = 10234; $candidate <= 98765; ++$candidate) {
# we want to jump eg from 10992 to 11000
...
}ex;
...
}
- or download this
print "$candidate\n" unless $bad;