Given a string s containing digits and the wildcard '*', return the number of possible decodings, where '*' can represent any digit from 1 to 9. Pattern focus: Decode ways. Wildcards greatly expand the transition count, so each state must account for both one-character and two-character interpretations.
s = digit string with wildcard '*'
number of valid decodings
Example 1:
Input:
s = "*"
Output:
9
Explanation:
The wildcard can represent any digit from 1 to 9.
Example 2:
Input:
s = "1*"
Output:
18
Explanation:
The first digit can pair with any valid second digit choice.