You are viewing a single comment's thread. Return to all comments →
Perl:
sub matchingStrings { my ($strings, $queries) = @_; my %h; my @res; foreach (@$strings) { $h{$_} +=1; } foreach my $el (@$queries) { if ($h{$el}) { push(@res, $h{$el}); } else { push(@res, 0); } } return @res; }
Seems like cookies are disabled on this browser, please enable them to open this website
Sparse Arrays
You are viewing a single comment's thread. Return to all comments →
Perl: