Logo
IconChallenge
Icon
IconProblem
IconSolutions
IconSubmissions

Decrypt String from Alphabet to Integer Mapping

XPChallenge Points: 10
levelLevel: Easy

You are given a string s containing digits and the character #. This string represents an encoded message.
The decoding rules follow these mappings:

  • The numbers 1–9 correspond directly to letters 'a'–'i'.

  • The numbers 10–26, when followed by #, map to letters 'j'–'z'.

Your job is to convert the encoded string into the decoded lowercase English alphabet string.
You are guaranteed that the encoding is always valid and maps to exactly one possible output.

Example 1:

Input: s = "20#5#3"

Output: "tes"

Explanation:

20# → 't', 5 → 'e', 3 → 'c'

Example 2:

Input: s = "1 2 3 4 5" → Actually encoded without spaces: "12345"

Output: "abcde"

Explanation:

Each number maps individually: 1→a, 2→b, 3→c, 4→d, 5→e

to Continue
like
dislike

Accepted:

Submission:

IconReport an issue
Icon
IconCode
IconYou need toto run or submitYou need toto run or submit
IconTest Case
IconTest Result