You are viewing a single comment's thread. Return to all comments →
Perl:
sub twoStrings { my @str1 = split("", shift); my @str2 = split("", shift); my %h; for (my $k = 0; $k <= scalar(@str1) - 1; $k++) { $h{$str1[$k]} = 0; } for (my $i = 0; $i <= scalar(@str2) - 1; $i++) { if (exists($h{$str2[$i]})) { return "YES"; } } return "NO"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Two Strings
You are viewing a single comment's thread. Return to all comments →
Perl: