Two sum: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: tweaks to avoid warnings, show revised output) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: oops, missing parens) |
||
Line 1,455: | Line 1,455: | ||
my @numbers = <0 2 11 19 90>; |
my @numbers = <0 2 11 19 90>; |
||
my @indices = two_sum(21, @numbers); |
my @indices = two_sum(21, @numbers); |
||
say join |
say join(', ', @indices) || 'No match'; |
||
@indices = two_sum(25, @numbers); |
@indices = two_sum(25, @numbers); |
||
say join |
say join(', ', @indices) || 'No match';</lang> |
||
{{out}} |
{{out}} |
||
<pre>1, 3 |
<pre>1, 3 |