"qvmwtmzzse" is the given string. We can make the first two partitions as ‘q’, ‘v’, but ‘m’ can not be an individual partition because there is another occurrence of m at index 6. So, the minimum length of the third partition is from index 3 to 6 and the partition is "mwtm". Similarly, the next partitions are "zz", ‘s’, ‘e’.
The first line of input contains an integer ‘T’, denoting the number of test cases. The test cases follow. The first line of each test case contains a string ‘S’ consisting of lowercase English letters.
Print the size of the partitions of the string on a single line separated by space. Note that you need to maximize the number of partitions. Print the output of each test case in a new line.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1<= T <= 10^3 1 <= |S| <= 10^3 Where |S| is the size of the given string ‘S’. Time Limit: 1 sec