Jump to content

Two sum: Difference between revisions

m
→‎{{header|Perl}}: oops, missing parens
m (→‎{{header|Perl}}: tweaks to avoid warnings, show revised output)
m (→‎{{header|Perl}}: oops, missing parens)
Line 1,455:
my @numbers = <0 2 11 19 90>;
my @indices = two_sum(21, @numbers);
say join (', ', @indices) || 'No match';
 
@indices = two_sum(25, @numbers);
say join (', ', @indices) || 'No match';</lang>
{{out}}
<pre>1, 3
2,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.