← Back to challenges

Decrypt the String from Digits to Letters

PythonHardconditionscryptographyloopsstrings

Instructions

Given a string s consisting from digits and #, translate s to English lowercase characters as follows:

  • Characters ("a" to "i") are represented by ("1" to "9").
  • Characters ("j" to "z") are represented by ("10#" to "26#").

Examples

decrypt("10#11#12") ➞ "jkab"

decrypt("1326#") ➞ "acz"

decrypt("25#") ➞ "y"

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.