Solved LeetCode program · 943 of 1,000
#1309 · Decrypt String from Alphabet to Integer Mapping
Original English source
The source is "10#11#12". The size is the number of characters in source. The alphabet is "abcdefghijklmnopqrstuvwxyz". The pieces is an empty list of text. The spot is 0.
Repeat while spot is less than size.
The here is character spot of source. The width is 1. If spot plus 2 is less than size and character (spot plus 2) of source is "#", set width to 3. The value is the digit value of here. The nextdigit is 0. If width is 3, set nextdigit to the digit value of character (spot plus 1) of source. If width is 3, set value to value times 10 plus nextdigit. The piece is the slice of alphabet from value minus 1 to value. Place piece into pieces. Add width to spot.
The line is join pieces with "". Show line.
Expected stdout
jkab