Statistics

Problem Statement for "StringDup"

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)

Constraints

    Examples


      This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
      This problem was used for: