TopCoder problem "Wordless" used in SRM 17 (Division I Level Two , Division II Level Two)



Problem Statement

    
Class Name: Wordless
Method Name: stripWord
Parameters: String
Parameters: String

Ned has a strange disease that causes his body temperature to rise
uncontrollably until he fries whenever he reads an email containing the word
"word".  To combat this disease, he needs a filter to filer his email and
completely removes all instances of the string "word".  The filter should NOT
be case sensitive.  The filter should parse the input from left to right
removing all instances of "word".  If there are still instances of "word" after
one pass the filter should parse the string again (and again...) until no
instances remain.  That is, the result of filtering "awwowordrdordb" is "ab".

Help keep Ned from frying by implementing a class Wordless which contains a
method stripWord.  The method takes a String as a parameter and returns a
String that is the input String with all instances of "word" completely
removed, as specified above.

Here is the method signature (be sure your method is public):
String stripWord(String text);

Examples:
"ThisWORDisaWWORDordtest" should return "Thisisatest"
"wOrwOrwOrdDd" should return "".
"worworwor" should return "worworwor".
"normal text" should return "normal text".
"w o r d" should return "w o r d".
 

Definition

    
Class:Wordless
Method:stripWord
Parameters:String
Returns:String
Method signature:String stripWord(String param0)
(be sure your method is public)
    

Problem url:

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

Problem stats url:

http://www.topcoder.com/tc?module=ProblemDetail&rd=3016&pm=116

Writer:

Unknown

Testers:

Problem categories: