#C4031. Longest Unique String Length
Longest Unique String Length
Longest Unique String Length
You are given T test cases. For each test case, you are provided with N strings. Your task is to compute the number of distinct characters from all the strings combined, where each character is only counted once. More formally, for a test case with a collection of strings ( S = {s_1, s_2, \dots, s_N} ), let ( U = \bigcup_{i=1}^{N} {c : c \in s_i} ). You should output ( |U| ), the cardinality of the set of unique characters.
Read the input from standard input (STDIN) and write your output to standard output (STDOUT). Each test case’s answer should be output on a new line.
inputFormat
The first line of input contains a single integer T, representing the number of test cases. For each test case, the first line contains an integer N denoting the number of strings. The following N lines each contain a single string.
outputFormat
For each test case, output a single integer representing the number of distinct characters found across all N strings. Each result should be printed on its own line.## sample
2
3
abcdef
ghijkl
mnopqr
2
xyz
abc
18
6
</p>