Problem C: Generate Your Word

Time limit: 3 sec

Solve an easy problem. I will give you a word and your task is to generate maximum of your own word by using the letter of the given word. It is not necessary that the generated word will be a dictionary word.   Suppose the given word is “mac”. You can rearrange it in 5 ways (“mca”, “cma”, “cam”, “amc”, “acm”).

 

Input and Output:

Input contest of a sequence of lower case letter not more than 13 characters.

Output will be an integer the total number of rearranged word.

 

Sample Input

mac

linux

Sample Output

5

119

August Contest, 2014

Problem Setter: Mehadi Hossain

 

SUBMIT YOUR ANS

PDF Download link

Leave a Reply

Your email address will not be published. Required fields are marked *