We have a set of strings (set A) and a set of queries (set B). Each query is to check whether a string exists in set A or not. If yes, output this string.
Your task is to implement the following function:
void query(string A, int n, string B, int m);
Here, n is the number of strings in set A, m is the number of strings in set B. 1<=n,m<=500,000.
Submit the function only.
Output the strings in set B which exist in set A. The output should follow the original order of the strings in set B.
A=“ABC”, A=“CD”, A=“D”
B = “A”, B =“CD”, B=“BC”, B=“ABC”,
then you should output: