TopcoderArchiveVisit Topcoder
Archive
Algorithm problem

Lardless

Problem statement, definition, constraints, and public examples.

Problem Statement

Alejandro has gotten to the point where he can't read an email containing the
word "lard" without drooling all over his keyboard. To combat this problem he
filters his email with an algorithm that searches the body of the email for any
word containing the word lard, and strips it out. Make like Alex and create a
class Lardless, containing the method StripLard(String). It takes any kind of
string and removes all cases of the substring "lard", regardless of case. It
returns the depleted string. Remember, under no circumstances can the return
string contain the word lard, so make sure you take care of the case of lalardrd.
(Hint: Since this problem turned out to be a little harder than I had planned,
try starting by converting the input string to all lower case to begin with,
and take it from there.)

Definition

Class:
Lardless
Method:
stripLard
Parameters:
String
Returns:
String
Method signature:
String stripLard(String param0)
(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