# CHODE - Editorial

Author: Vitalij Kozhukhivskij
Tester: Mahbub
Editorialist: Jingbo Shang

Cakewalk

### PREREQUISITES:

Programming Language

### PROBLEM:

Given a simple encryption method using the frequency, decrypt n strings.

### EXPLANATION:

To solve this problem, the key is to get the mapping. That is:

1. Get the frequency of each character
in the input string (bins are used
here);
2. Sort them in order;
3. Find the mapping;
4. Decrypt it.

The time complexity is O(L), where L is the total length of the input strings.

### AUTHOR’S AND TESTER’S SOLUTIONS:

Author’s solution can be found here.
Tester’s solution can be found here.

1 Like

(if some of them appear equal number of times, then first in frequency sequence will be lower letter between them).

Dear Author ,

How can one understand this as that they have to give priority based on alphabetical order.

Some one commented that we have to consider aphabetical ordering incase two letters have same frequency. if the comment was not made i would have wasted my time on debugging my code for the whole contest.

5 Likes

very true…same happened with me…really poor description!!!

similar logiC but TLE each time in java
please see my submission : http://www.codechef.com/viewsolution/3088704

quite right…this problem cost me 8 WAs…worst problem statement ever read on codechef