Ways to decode
A message of capital letters was turned into digits, with A as 1, B as 2, and so on up to Z as 26, and the codes were written one after another with no gaps. So "LAB" becomes "1212", and so does "ABAB".
You get the digit string s. Count the letter messages that turn into exactly s and return that count. Every code is a number from 1 to 26 written without a leading zero: "8" is H, but "08" is not a code, and neither is "0" on its own. If no message fits, return 0.
s = "123"Output3ABC (1, 2, 3), LC (12, 3) and AW (1, 23).
s = "2101"Output1Only BJA (2, 10, 1). The 0 must join the 1 before it, which leaves the 2 alone, and "01" is not a code.
s = "50"Output0The 0 cannot stand alone, and 50 is bigger than 26.
1 ≤ len(s) ≤ 100
sholds only the digits 0 to 9, and it may start with 0.
Plan it first
Write a line for each before you code, then say them out loud. Compare with the Approach tab afterwards.