Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my ($L, $D, $N) = split ' ', scalar <>;
- my @words;
- for (1 .. $D) {
- chomp(my $word = <>);
- push @words, $word;
- }
- for my $case (1 .. $N) {
- chomp(my $pattern = <>);
- $pattern =~ tr/()/[]/;
- my $num_matches = 0;
- foreach (@words) { $num_matches++ if /$pattern/ }
- print "Case #$case: $num_matches\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement