The TransCompilator

Solved LeetCode program · 17 of 1,000

#0017 · Letter Combinations of a Phone Number

Medium String chunk-01.md

Original English source

Keep a shared digits as empty text. Place "23" into digits. Keep a shared alphabet as empty text. Place "abcdefghijklmnopqrstuvwxyz" into alphabet. Keep a shared current as empty text. Keep a shared answers as an empty list of text. Keep a shared copy as empty text.
To build from position (a whole number). If position is 2, The copy is a copy of current, Place copy into answers, then return. The digit is the digit value of character position of digits. The start is (digit minus 2) times 3.
For every offset from 0 to 2.
Place character (start plus offset) of alphabet into current. Build from position plus 1. Remove last character from current.

Build from 0. For each answer in answers, report answer.

Open in Playground Browse all 1,000 problems

Expected stdout

ad
ae
af
bd
be
bf
cd
ce
cf