TopCoder problem "VowelEncryptor" used in SRM 329 (Division II Level One)



Problem Statement

    

You are given a String[] text, each element of which contains a single word. Encrypt the text by removing all vowels ('a', 'e', 'i', 'o', 'u') from every word that contains at least one non-vowel. If a word consists only of vowels, leave it as is. Return the result as a String[], where the ith element is the encrypted version of the ith element in text.

 

Definition

    
Class:VowelEncryptor
Method:encrypt
Parameters:String[]
Returns:String[]
Method signature:String[] encrypt(String[] text)
(be sure your method is public)
    
 

Constraints

-text will contain between 1 and 50 elements, inclusive.
-Each element of text will contain between 1 and 20 lowercase letters ('a'-'z'), inclusive.
 

Examples

0)
    
{"hello", "world"}
Returns: {"hll", "wrld" }
1)
    
{"a", "b", "c"}
Returns: {"a", "b", "c" }
2)
    
{"he", "who", "is", "greedy", "is", "disgraced"}
Returns: {"h", "wh", "s", "grdy", "s", "dsgrcd" }

Problem url:

http://www.topcoder.com/stat?c=problem_statement&pm=7290

Problem stats url:

http://www.topcoder.com/tc?module=ProblemDetail&rd=10009&pm=7290

Writer:

dmytro

Testers:

PabloGilberto , brett1479 , Olexiy , lovro

Problem categories:

String Manipulation