A message of letters A–Z was encoded as numbers: 'A' → '1','B' → '2', ..., 'Z' → '26'. Given the digit string digits, return
how many ways it can be decoded.
'12' is 'AB' or 'L': 2 ways. A '0' can never stand alone, and a
leading zero like '06' is not a valid code, so zeros are where most attempts
break.
ways[i] (ways to decode the first i digits) comes from at most two places:
the last digit alone, if it is 1–9, adds ways[i - 1]; the last two
digits together, if they form 10–26, add ways[i - 2].
Examples
solve('12') → 2 // 'AB', 'L'
solve('226') → 3 // 'BZ', 'VF', 'BBF'
solve('06') → 0Constraints
1 <= digits.length <= 100, digits onlySample tests