Statistics

Problem Statement for "DeAnagram"

Problem Statement

PROBLEM STATEMENT:
You are given a list of lowercase words.  Write down each letter as many times
as it appears in the word that has the most occurrences of that letter and then
arrange the letters in alphabetical order.  
For example if the list contains the words: paper, ape, pear  you should return
aeppr because within the words: 'a' appears at most once, 'e' appears at most
once, 'p' appears at most twice, and 'r' appears at most once.


DEFINITION:
 Class Name:  DeAnagram
Method Name:  prearrange
 Parameters:  String[]
    Returns:  String
method signature (make sure your method is public) String prearrange(String[]
words)

TopCoder will ensure the validity of these inputs
- words is a String[] with 1 to 50 elements inclusive.
- each element in the String[] contains lower case characters 'a'-'z' only.
- each element in the String[] is between 1 and 50 characters inclusive in
length.

EXAMPLES:
words={"lever"}					return "eelrv"		  
words={"whale", "awash", "bale"} 		return "aabehlsw"	  
words={"money", "mono", "men", "coy"}		return "cemnooy"	  
words={"sellers", "less"}			return "eellrss"  
words={"eccentric", "mop", "use"}		return "ccceeimnoprstu"

Definition

Class:
DeAnagram
Method:
prearrange
Parameters:
String[]
Returns:
String
Method signature:
String prearrange(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: