TopcoderArchiveVisit Topcoder
SRM17 Sep 2001
SRM 31

WheelOfFortune

Problem statement, definition, constraints, and public examples.

Problem Statement

Class name: WheelOfFortune
Method name: buyAVowel
Parameters: String, String
Returns: boolean

Write a class WheelOfFortune with a method buyAVowel that takes two Strings of
equal length which consist of letters ('A'-'Z' inclusive), spaces (' '), and
blanks ('_', underscore character).  buyAVowel returns a boolean value which
represents whether or not the second String can be made from the first by
replacing blanks in the first String with letters that do not already appear in
the first String.  Furthermore, only one of these new letters may be a vowel
(there may be multiple copies of that vowel).  Vowels consist of the
characters: 'A','E','I','O','U'.  The character 'Y' is not a vowel.    Blanks
may NOT be replaced by spaces.
The method signature is:
boolean buyAVowel (String start, String end) (be sure the method is declared
public)

Each String will contain only capital letters (A-Z, inclusive), underscores
('_'), and spaces (' ') and will have a length between 1 and 50, inclusive
(TopCoder will check).
EXAMPLES:
"__E CA_ __ __E CA_" "T_E CAT I_ T_E CAT" returns true.
"__E CA_ __ __E _A_" "T_E CAT I_ T_E CAT" returns false - a 'C' was added when
there already was one.
"___ ___ __ ___ ___" "__E ___ I_ __E ___" returns false - two different vowels
were added.
"TH_ CAT __ TH_ HAT" "TH_ HAT __ TH_ CAT" returns false - something other than
a blank was replaced.
"__________________" (18 underscore characters) "THE_C_T__N_THE_H_T" returns
true.
"__________________" (18 underscore characters) "THE C_T _N THE H_T" returns
false - spaces were added.

Definition

Class:
WheelOfFortune
Method:
buyAVowel
Parameters:
String, String
Returns:
boolean
Method signature:
boolean buyAVowel(String param0, String param1)
(be sure your method is public)

Constraints

    Examples

      No public sample cases were explicitly marked for this problem in the original data.

      Back to all problems