TopcoderArchiveVisit Topcoder
Archive
Algorithm problem

BetaHard1

Problem statement, definition, constraints, and public examples.

Problem Statement

Class Name: BetaHard1
Method Name: solve
parameters:  String, String
returns: int

Create a class BetaHard1 containing the method solve. This method will take two
Strings as inputs and return the number of characters in the second String that
are contained in the first string, in a one-to-one relationship.  That is, if a
character is repeated in the second string, it must be repeated in the first
string to count more than once.

Here is the method signature:
public int solve(String input1, String input2);

BOth Strings will have fewer than 50 characters.

Note:
-The method is case sensitive.  A is a different character than a.

Examples:
("java", "abava") -> 3  (two of the (a)s and the (v))
("TopCoder", "code guru") -> 4
("foobar", "sing") -> 0 

Definition

Class:
BetaHard1
Method:
solve
Parameters:
String, String
Returns:
int
Method signature:
int solve(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