|
||||||||||
A Count TaskTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3790 Accepted Submission(s): 1310 Problem Description Count is one of WNJXYK’s favorite tasks. Recently, he had a very long string and he wondered that how many substrings which contains exactly one kind of lowercase in this long string. But this string is so long that he had kept counting for several days. His friend Kayaking wants to help him, so he turns to you for help. Input The input starts with one line contains exactly one positive integer $T$ which is the number of test cases. Each test case contains one line with a string which you need to do a counting task on. Output For each test case, output one line containing “y” where y is the number of target substrings. Sample Input
Sample Output
Hint 1<=T<=20,1<=len(string)<=10^5,1<=∑len(string)<=10^5 Strings only contain lowercase English letters. Source | ||||||||||
|