EllysPronunciation
Rookie SRM 10 · 2022-02-07 · by espr1t
Problem Statement
You are given the words that Elly has learned this week in the
Notes
- For this problem we will consider the letters 'a', 'e', 'i', 'o', and 'u' to be vowels, and all other - consonants.
Constraints
- words will contain between 1 and 50 elements, inclusive.
- Each element of words will contain between 1 and 50 characters, inclusive.
- All elements of words will contain only lower-case letters of the English alphabet ('a'-'z').
{"wrath", "allure", "vorliebe", "abneigung", "amor", "voulez", "ecoeurement", "odiar"}
Returns: 4
The example from the problem statement.
{"schornsteinfeger", "schmetterling", "lohnsteuerabzugsbescheinigung", "shifffahrt",
"deutsch", "ist", "die", "schoenste", "sprache", "auf", "der", "welt"}
Returns: 0
The German is a horrible language.
{"hearing", "vision", "smell", "touch", "taste",
"denial", "anger", "bargaining", "depression", "acceptance",
"war", "famine", "plague", "death",
"pog", "story", "sarah", "gender", "baleen",
"posh", "sporty", "scary", "ginger", "baby", "spice"}
Returns: 5
Here the good words are {"vision", "denial", "famine", "plague", "baleen"}.
{"this", "was", "a", "triumph",
"i", "am", "making", "a", "note", "here", "huge", "success",
"its", "hard", "to", "overstate", "my", "satisfaction"}
Returns: 5
It is possible that some of the given words are repeated, or consist of a single character. Please also note that in this problem we consider 'y' to be a consonant.
{"wir", "werden", "alle", "sterben", "haltet", "euch", "bereit",
"die", "zeichen", "sind", "eindeutig", "bald", "ist", "es", "soweit",
"vielleicht", "schon", "heute", "abend", "vielleicht", "in", "einem", "jahr",
"doch", "alle", "verden", "sterben", "traurig", "aber", "wahr"}
Returns: 8
Here the eight good words are: "alle", "euch", "bereit", "es", "soweit", "in", "alle", and "aber". Please note that each good word should be counted as many times as it is present in the list (in this example "alle" should be counted twice).
Submissions are judged against all 112 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class EllysPronunciation with a public method int getGood(vector<string> words) · 112 test cases · 2 s / 256 MB per case