#C8113. Maximum Uniqueness Value

    ID: 52060 Type: Default 1000ms 256MiB

Maximum Uniqueness Value

Maximum Uniqueness Value

In this problem, you are given a string ( s ). Your task is to compute the maximum uniqueness value among all substrings of ( s ). The uniqueness value of a substring is defined as the number of distinct characters present in it. Note that the maximum uniqueness value of ( s ) is simply the number of distinct characters in ( s ), since one can always choose the substring that is the entire string and obtain all distinct characters.

For example, given the string abc, the maximum uniqueness value is 3, and for aabb, it is 2.

The input consists of several test cases, and for each test case you need to output the maximum uniqueness value of the provided string.

inputFormat

The input is read from standard input and has the following format:

( t ): An integer representing the number of test cases.
Each of the next ( t ) lines contains a single string ( s ).

It is guaranteed that ( 0 \leq |s| \leq 10^5 ).

outputFormat

For each test case, output the maximum uniqueness value on a separate line to standard output.## sample

3
abc
aabb
abcdabcd
3

2 4

</p>