MissingLetters
TCO '03 Qual. Round 1 · 2003-10-07 · by lars2520
TCO '03 Qual. Round 1 · 2003-10-07 · by lars2520 · Simple Search, Iteration, String Manipulation
Problem Statement
Problem Statement
The sentence "A quick brown fox jumps over the lazy dog" contains every single letter in the alphabet. Such sentences are called pangrams. You are to write a method getMissingLetters, which takes a String , sentence, and returns all the letters it is missing (which prevent it from being a pangram). You should ignore the case of the letters in sentence, and your return should be all upper case letters, in alphabetical order.
Constraints
- sentence will contain between 0 and 50 characters, inclusive.
- Each character of sentence will have ASCII value between 32 and 126, inclusive.
Examples
0)
"A quick brown fox jumps over the lazy dog" Returns: ""
This sentence contains every letter.
1)
"A slow yellow fox crawls under the proactive dog" Returns: "BJKMQZ"
2)
"Lions, and tigers, and bears, oh my!" Returns: "CFJKPQUVWXZ"
3)
"" Returns: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
4)
"The five boxing wizards jump quickly." Returns: ""
Submissions are judged against all 51 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Coding Area
Language: C++17 · define a public class MissingLetters with a public method string getMissingLetters(string sentence) · 51 test cases · 2 s / 256 MB per case