You have a sequence of lowercase characters that you want to encrypt.
The first
By "shifted by", we mean that if c
was the most frequently occurring character, the character would be shifted ahead by c
is the third letter of the alphabet), modulo b
becomes e
, and z
becomes c
).
Input Specification
The first line of input contains
Output Specification
One line, containing the encrypted version of the
Sample Input
Copy
5
abbaabbacdecde
Output for Sample Input
Copy
abbaacdcdegdgh
Troy Vasiga
Comments
I think the sample output may be incorrect.
Take the third last character (c) and the previous 5 characters(bacde) The shift with b should be 2 instead of 1.
Therefore shouldn't d be e?
Helpful Notice
By
Mr. Vasiga means in the original, unaltered string.