A message of digits maps to letters with A = 1 … Z = 26. Given the digit string s, return the number of ways it can be decoded.
A
1
Z
26
s
s = "12"
2
Why
"AB" (1 2) or "L" (12)
s = "226"
3
1 <= s.length <= 100 `s` contains digits only and may contain leading zeros.
Topics
Implement numDecodings in the editor and return the answer — printing it is never graded.
numDecodings
Problem 92 of 1146 in the arena