note
AnomalousMonk
<blockquote><i>
If initial array has even length, I want to double the length, otherwise I want doubled and -1 length. <br>
... <br>
Where $n - is a length of final array ... <br>
... <br>
<c>push @array, reverse @array[ 0 .. int( $n / 2 ) - 1 ];</c>
</I></BLOCKQUOTE>
<p>
Why bother figuring out the length <c> $n </C> of the final, palindromatized array when this length is inherent in the initial array? <br>
<c> push @array, reverse @array[ 0 .. $#array - (@array & 1) ];</c> <br>
(This is essentially [vr]'s [id://1230477|solution]. <small>(<b>Update:</B> To be quite fair, [1nickt] [id://1230475|here] and [poj] [id://1230476|here] also had essentially the same solution, and with earlier precedence.)</SMALL>)
</P>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-634253">
<hr><p>Give a man a fish<b>:</B> <c> <%-{-{-{-<</C></P>
</div></div>
1230472
1230501