sub two_sum_Discipulus { my ($input, $target) = @_; foreach my $index ( 0 .. $#$input ){ ( $_ != $index and $input->[$_] + $input->[$index] == $target ) ? return [$index, $_] : 0 for 0 .. $#$input; } }