A message uses the code A = 1, B = 2, ..., Z = 26. Given a string s of digits, return the number of ways to decode it into letters (a digit group like "06" or "0" alone is not a valid code). The answer is returned modulo 10**9 + 7.
For "12" the answer is 2 (AB or L); for "226" it is 3; for "06" it is 0.
Example 1
Input:
num_decodings('12')
Output:
2
Example 2
Input:
num_decodings('226')
Output:
3
Example 3
Input:
num_decodings('06')
Output:
0
0 <= len(s) <= 200000s contains only digits.No results yet
Run your code to check it against the examples, or submit to run every test.