sub two_sum_choroba { my ($input, $target) = @_; my %seen; for my $i (0 .. $#$input) { my $x = $input->[$i]; return [$i, $seen{ $target - $x }] if exists $seen{ $target - $x }; $seen{$x} = $i; } }