TopcoderArchiveVisit Topcoder
SRM18 Jul 2002
SRM 105

LetterSet

Problem statement, definition, constraints, and public examples.

Problem Statement

Write a method which, given a String[] over the alphabet 'A'-'Z', figures out the set of letters that are not present in the String's and orders them alphabetically.

Definition

Class:
LetterSet
Method:
compliment
Parameters:
String[]
Returns:
String
Method signature:
String compliment(String[] str)
(be sure your method is public)

Constraints

  • str contains between 0 to 50 elements, inclusive.
  • Each element of str contains between 1 and 50 characters, inclusive.
  • Each element of str contains only the capital letters 'A'-'Z'.

Examples

  1. {"A"}
    Returns: "BCDEFGHIJKLMNOPQRSTUVWXYZ"
  2. {"ACE", "LACE"}
    Returns: "BDFGHIJKMNOPQRSTUVWXYZ"
  3. {"X", "XYZ"}
    Returns: "ABCDEFGHIJKLMNOPQRSTUVW"
Back to all problems