All Tracks Algorithms String Algorithms String Searching Problem

Little Monk and Good String
Tag(s):

Ad-Hoc, Basic Programming, Easy, String Algorithms

Problem
Editorial
Analytics

Little monk loves good string. Good String is a string that only contains vowels $$(a, e, i, o, u)$$. Now, his teacher gave him a string $$S$$. Little monk is wondering what is the length of the longest good string which is a substring of $$S$$.

Note: Strings contains only lower case English Alphabets.

Input:
First line contains a string $$S$$, $$(1 \le |S| \le 10^5)$$, where $$|S|$$ denotes the length of the string.

Output:
Print an integer denoting the length of the longest good substring, that is substring consists of only vowels.

SAMPLE INPUT
abcaac
SAMPLE OUTPUT
2
Explanation

Longest Good String which is a substring of $$S$$ is $$aa$$ so the answer is $$2$$.

Time Limit: 1.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

HackerEarth

Challenge Name

CodeMonk (Arrays & Strings)

OTHER PROBLEMS OF THIS CHALLENGE
Notifications
View All Notifications