Decrypt String from Alphabet to Integer Mapping

EasyStringssimulation

Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.

Practice this as a mock interviewFree to start, no account needed

Problem

A string s of digits and '#' characters encodes lowercase letters: 'a' through 'i' are written as the single digits "1" through "9", and 'j' through 'z' are written as the two digits "10" through "26" followed by '#'. Decode s and return the resulting lowercase string. The input is always a valid encoding, so the decoding is unique.

Examples

Input: s = "10#11#12"
Output: "jkab"
`10#` is j, `11#` is k, then `1` is a and `2` is b.
Input: s = "1326#"
Output: "acz"
`1` is a, `3` is c, and `26#` is z.
Input: s = "25#"
Output: "y"
A single two-digit code.

Constraints

  • 1 <= s.length <= 1000
  • `s` consists of digits and `'#'`
  • `s` is a valid encoding

What the interviewer grades

A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.

More simulation problems