Longest palindromic substrings: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: fixed two typos.) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: Don't bother check to see if a character is equal to itself. Pro tip: it is.) |
||
Line 626: | Line 626: | ||
loop { |
loop { |
||
last if $i >= @chars; |
last if $i >= @chars; |
||
for |
for 1, 2 { |
||
my int ($rev, $fwd) = $_, |
my int ($rev, $fwd) = $_, 1; |
||
loop { |
loop { |
||
last if ($rev > $i) || (($i + $fwd) == @chars) || (@chars[$i - $rev] ne @chars[$i + $fwd]); |
|||
$rev = $rev + 1; |
$rev = $rev + 1; |
||
$fwd = $fwd + 1; |
$fwd = $fwd + 1; |