TopCoder problem "StringDup" used in TCCC '01 Round 2 (Division I Level One)



Problem Statement

    
Create a class called StringDup. Given a string made up of ONLY letters and
digits, determine which character is repeated the most in the string ('A' is
different than 'a'). If there is a tie, the character which appears first in
the string (from left to right) should be returned.

Examples :

aaiicccnn = c
aabbccdd = a
ab2sbf2dj2skl = 2

Here is the method signature :

public char getMax(String input);

We will check to make sure that the input contains only letters and digits (no
punctuation marks or spaces).
 

Definition

    
Class:StringDup
Method:getMax
Parameters:String
Returns:char
Method signature:char getMax(String param0)
(be sure your method is public)
    

Problem url:

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

Problem stats url:

http://www.topcoder.com/tc?module=ProblemDetail&rd=2001&pm=40

Writer:

Unknown

Testers:

Problem categories:

String Manipulation