TopcoderArchive
TCO7 Oct 2003
TCO '03 Qual. Round 1

MissingLetters

Problem statement, definition, constraints, and public examples.

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.

Definition

Class:
MissingLetters
Method:
getMissingLetters
Parameters:
String
Returns:
String
Method signature:
String getMissingLetters(String sentence)
(be sure your method is public)

Constraints

  • sentence will contain between 0 and 50 characters, inclusive.
  • Each character of sentence will have ASCII value between 32 and 126, inclusive.

Examples

  1. "A quick brown fox jumps over the lazy dog"
    Returns: ""
    This sentence contains every letter.
  2. "A slow yellow fox crawls under the proactive dog"
    Returns: "BJKMQZ"
  3. "Lions, and tigers, and bears, oh my!"
    Returns: "CFJKPQUVWXZ"
  4. ""
    Returns: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Back to all problems