Git Custom Command

5

1 votes
Very-Easy
Problem

In git, we have this command git log --stat. It shows the list of commits and for each commit it shows the files that were changed in that commit.

I wanted to find that, in my lifetime of commits, how many times have I changed one particular file. How do I do that?

Input Format:
First line will contain N, the number of filenames that I have changed so far in all the commits.
Following N lines. each will contain the filepath (because there can be same filename with different path)
Next line will contain, Q, number of queries I have.
Following Q lines, each will contain the filepath for which I want to know how man times that particular file was changed.

Output Format:
For each query, print the answer in a new line.

Input Constraints:
1N50000
1Q100000
Length of any filepath will not exceed 50.
It is guaranteed that the filepath in the query will always be one among the N filepaths given in input.

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

?