Count and Count

0

0 votes
Easy
Problem

There is a collection of input strings and a collection of query strings. For each query string,
determine how many times it occurs in the list of input strings.

EXAMPLE:

    For example, given input strings['ab', 'ab', abc']  and queries ['ab', 'abc', 'bc'],
    we find 2 instances of 'ab',1 of 'abc' and 0 of 'bc'. 

INPUT:
    The first line contains an integer n, the size of strings.
    Each of the next n lines contains a string.
    The next line contains q, the size of queries.
    Each of the next q lines contains a string. 

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?