Help for this page

Select Code to Download


  1. or download this
      $string =~ /(.{$n}).*\1/;
    
  2. or download this
      sub longestrepeat {
        my($string) = @_;
    ...
          return $n - 1 unless $string =~ /(.{$n}).*\1/;
        }
      }
    
  3. or download this
      $string =~ /(.{$n}).*\1.*\1/;