EllysNewNickname
SRM 577 · 2012-12-13 · by espr1t
Problem Statement
You are given the current nickname Elly uses in the
Notes
- Note that no matter which vowels Elly decides to remove, the length of the resulting nickname will be the same.
- In Elly's language (and in this problem) 'y' is considered a vowel.
Constraints
- nickname will contain between 1 and 50 characters, inclusive.
- nickname will contain only small letters of the English alphabet ('a'-'z').
Statement by TopCoder, Inc. — view the original on the archive.
"tourist" Returns: 6
The nickname "tourist" can become either "turist" or "torist". Its new length will be 6 characters.
"eagaeoppooaaa" Returns: 6
Although there are many possible resulting nicknames, her strategy guarantees that the length of all of them will be 6. One of the possibilities in this case is "ageppo".
"esprit" Returns: 6
There are cases in which the nickname remains the same.
"ayayayayayaya" Returns: 1
The initial nickname can contain only vowels or only consonants.
"wuuut" Returns: 3
Wut?
Submissions are judged against all 111 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class EllysNewNickname with a public method int getLength(string nickname) · 111 test cases · 2 s / 256 MB per case