#P1760B. Atilla's Favorite Problem
Atilla's Favorite Problem
Description
In order to write a string, Atilla needs to first learn all letters that are contained in the string.
Atilla needs to write a message which can be represented as a string . He asks you what is the minimum alphabet size required so that one can write this message.
The alphabet of size () contains only the first Latin letters. For example an alphabet of size contains only the characters , , and .
The first line contains a single integer () — the number of test cases.
The first line of each test case contains a single integer () — the length of the string.
The second line of each test case contains a string of length , consisting of lowercase Latin letters.
For each test case, output a single integer — the minimum alphabet size required to so that Atilla can write his message .
Input
The first line contains a single integer () — the number of test cases.
The first line of each test case contains a single integer () — the length of the string.
The second line of each test case contains a string of length , consisting of lowercase Latin letters.
Output
For each test case, output a single integer — the minimum alphabet size required to so that Atilla can write his message .
Note
For the first test case, Atilla needs to know only the character , so the alphabet of size which only contains is enough.
For the second test case, Atilla needs to know the characters , , , . The smallest alphabet size that contains all of them is (such alphabet can be represented as the string ).