[Rio-pm] [OT-GOLF] Merge

Fernando Oliveira fernandocorrea em gmail.com
Quinta Fevereiro 4 05:50:00 PST 2010


Feio, mas funciona e é menor:

sub merge{@a=split//,shift;@b
=split//,shift;join"",map{$a[$_].$b[$_]}0..($#a+$#b)}

Just another Perl Hacker,
Fernando (SmokeMachine)
http://perl-e.org
Sent from Rio De Janeiro, RJ, Brazil


2010/2/4 Fernando Oliveira <fernandocorrea em gmail.com>

> 2a:
>
> sub merge{@a=split//,shift;@b
> =split//,shift;join"",map{$a[$_].$b[$_]}0..($#a>$#b?$#a:$#b)}
>
>
> Just another Perl Hacker,
> Fernando (SmokeMachine)
> http://perl-e.org
> Sent from Rio De Janeiro, RJ, Brazil
>
>
> Em 4 de fevereiro de 2010 11:38, Fernando Oliveira <
> fernandocorrea em gmail.com> escreveu:
>
> sub merge{@a=split//,shift;@b
>> =split//,shift;join"",map{shift(@a).shift(@b)}0..($#a>$#b?$#a:$#b)}
>>
>
>
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://mail.pm.org/pipermail/rio-pm/attachments/20100204/eee8c3b2/attachment-0001.html>


Mais detalhes sobre a lista de discussão Rio-pm