Help for this page

Select Code to Download


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