Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
8
Task/Rep-string/Perl/rep-string.pl
Normal file
8
Task/Rep-string/Perl/rep-string.pl
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
foreach (qw(1001110011 1110111011 0010010010 1010101010 1111111111 0100101101 0100100 101 11 00 1)) {
|
||||
print "$_\n";
|
||||
if (/^(.+)\1+(.*$)(?(?{ substr($1, 0, length $2) eq $2 })|(?!))/) {
|
||||
print ' ' x length $1, "$1\n\n";
|
||||
} else {
|
||||
print " (no repeat)\n\n";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue