20 lines
246 B
Raku
20 lines
246 B
Raku
@a = (1, 2, 3);
|
|
@b = (4, 5, 6);
|
|
@array = addem (\@a, \@b);
|
|
|
|
print @array;
|
|
|
|
|
|
sub addem
|
|
{
|
|
my ($ref1, $ref2) = @_;
|
|
|
|
while (@{$ref1}) {
|
|
|
|
unshift @result, pop(@{$ref1}) + pop(@{$ref2});
|
|
|
|
}
|
|
|
|
return @result;
|
|
}
|