274. Decode Ways II
A message containing letters from `A-Z` can be encoded into numbers using the mapping `'A' -> "1"`, `'B' -> "2"`, ..., `'Z' -> "26"`. To decode an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping above (there may be multiple ways). For example, `"11106"` can be mapped into `"AAJF"` (grouped as `1 1 10 6`) or `"KJF"` (grouped as `11 10 6`). In addition to the mapping above, an encoded message may contain the `'*'` character, which can represent any digit from `'1'` to `'9'` (`'0'` is excluded). Given a string `s` consisting of digits and `'*'` characters, return the **number of ways** to decode it. Since the answer may be very large, return it **modulo** `10^9 + 7`.
Examples
Input: *
Output: 9
Explanation: '*' represents any of 1-9, i.e. letters A-I: 9 ways.
Constraints
- 1 <= s.length <= 10^5
- s[i] is a digit or '*'.
Run checks all cases above. Submit evaluates all test cases.