All Tracks Algorithms String Algorithms String Searching Problem

Vowel Phelia
Tag(s):

Easy, Implementation, String Algorithms, Two-pointer, approved

Problem
Editorial
Analytics

Alice and Bob are playing a game in which Bob gives a string $$S$$ of length $$N$$ consisting of lowercase English alphabets to Alice and ask her to calculate the number of sub-strings of this string which contains exactly $$3$$ vowels.

There will be $$T$$ test cases in the input and output the answer for each test case in a new line.

Sample Input:

The first line contains a single integer $$T$$. Each test case will consist of two lines, first line containing length of string and second line will contain the string.

Sample Output: :

Print the answer for each test case in a new line.

Constraints:

$$ 1 \le T \le 20 $$

$$ 1 \le N \le 10^5 $$

SAMPLE INPUT
1
5
aebco
SAMPLE OUTPUT
1
Explanation

Only one substring is possible which is given by aebco.

Time Limit: 5.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: C, C++, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Scala 2.11.8, Swift, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

This Problem was Asked in

Accolite

Challenge Name

Accolite Java Developer Hiring Challenge

OTHER PROBLEMS OF THIS CHALLENGE
Notifications
View All Notifications