String Set
Time limit2sMemory limit1536 MB
Count how many of M query strings appear in a given set S of N strings.
- Level
Easy2 of 10
- Topics
- Hash map
- Solved
- No attempts yet
Problem
You are given a set of strings.
Write a program that counts how many of the given strings are contained in the set .
Input
The first line contains the numbers of strings and (, ).
Each of the next lines contains a string in the set .
Each of the following lines contains a string to check.
Every string in the input consists only of lowercase English letters, and its length is at most 500. No string appears more than once in the set .
Output
Print on the first line how many of the strings are contained in the set .