TopcoderArchiveVisit Topcoder
SRM10 Jul 2001
SRM 12

Combiner

Problem statement, definition, constraints, and public examples.

Problem Statement

Class Name:  Combiner
Method Name: combine
Parameters:  String,String
Returns:     String

Implement a class Combiner, which contains a method combine.  The method takes
two Strings as parameters and combines them, alternating letters, starting with
the first letter of the first String, followed by the first letter of the
second String, then second letter of first String, etc.  The remaining letters
of the longer String are then appended to the end of the combination String and
this combination String is returned.

Here is the method signature:
public String combine(String s1,String s2);

s1 and s2 are Strings of length between 1 and 50 letters, inclusive.

Examples:
If s1="Tpo" and s2="oCder" the method returns "TopCoder".
If s1="aa" and s2="bb" the method returns "abab".

Definition

Class:
Combiner
Method:
combine
Parameters:
String, String
Returns:
String
Method signature:
String combine(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