Official algorithmic problem description and constraints.
Polycarp has a string π , which consists of lowercase Latin letters. He encodes this string using the following algorithm:
For example, encoding the string s="codeforces" happens as follows:
The string π and replacements for π ="codeforces".
Thus, the result of encoding the string π ="codeforces" is the string "serofedsoc".
Write a program that performs decoding β that is, restores the original string π from the encoding result.
Detailed video explanations, mathematical intuition, and clean C++ implementation code.