Substring
Practice
3.2 (6 votes)
Basic programming
Open
Approved
Easy
Mathamatics
Problem
67% Success 4317 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Maggu has just joined play school. His teacher taught him A,a,B,b,C,c. He is much fascinated with these letters and now he is looking only for those strings which contains these letters only. But as i said he is a little guy he cant calculate the number of such sub-strings alone. So,he asked you (The String Calculator) for help.

Help little Maggu as i am not there to help him.

Refer test cases for better understanding

INPUT:

First line of input contains a single integer t denoting the number of test cases.Each test case consists of a single line containing string denoting maggu's search space.

OUTPUT:

Output consists of t lines each containing number of such substrings which contains only letters from the maggu's set of characters.

CONSTRAINTS:

t<=10

|strlen(str)| < =10^5

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
2 votes
Tags:
Easy
Points:20
19 votes
Tags:
Basic MathAlgorithmsMath
Points:20
4 votes
Tags:
MathematicsOpenApprovedEasyMathamatics