Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Eertree/Raku/eertree.raku
Normal file
18
Task/Eertree/Raku/eertree.raku
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
my $str = "eertree";
|
||||
my @pal = ();
|
||||
my ($strrev,$strpal);
|
||||
|
||||
for (1 .. $str.chars) -> $n {
|
||||
for (1 .. $str.chars) -> $m {
|
||||
$strrev = "";
|
||||
$strpal = $str.substr($n-1, $m);
|
||||
if ($strpal ne "") {
|
||||
for ($strpal.chars ... 1) -> $p {
|
||||
$strrev ~= $strpal.substr($p-1,1);
|
||||
}
|
||||
($strpal eq $strrev) and @pal.push($strpal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
say @pal.unique;
|
||||
Loading…
Add table
Add a link
Reference in a new issue