Given a string, find the length of the longest substring without repeating characters. For example, the longest substrings without repeating characters for “ABDEFGABEF” are “BDEFGA” and “DEFGAB”, with length 6.
The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is str.
Print the length of longest substring.
1 ≤ T ≤ 20
1 ≤ str ≤ 50
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.