Count how many different city names appear in each trip log.
Easy2Hash mapInterviewNo attempts yetTime limit1sMemory limit256 MBAlice travels a lot for work. On each trip she visits a single city and then returns home.
Someone recently asked her how many different cities she has visited for work. Alice kept a log of every trip, so the answer is in there. Count the cities she has visited at least once.
The first line contains the number of test cases T, a positive integer at most 50.
The first line of each test case contains the number of work trips n that Alice has taken so far, a positive integer at most 100. The next n lines describe those trips: the i-th of them contains the name of the city Alice visited on her i-th trip.
Alice's work only sends her to cities with simple names. A city name consists of lowercase letters only, has at least one letter, contains no spaces, and is at most 20 characters long.
For each test case, print a single line with the number of distinct cities Alice has visited on her work trips.