Medium Accuracy: 43.8% Submissions: 26404 Points: 4
Given a string 's'. The task is to find the smallest window length that contains all the characters of the given string at least one time.
For eg. A = “aabcbcdbca”, then the result would be 4 as of the smallest window will be “dbca”.
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains a string S.
For each test case in a new line print the length of the smallest such string.
1 <= T <= 100
1 <= |S| <= 105
Explanation: Testcase 1: Smallest window size is 4 which is of "dbca" which consists all characters of the string.