Ways to read a digit code
A message in capital letters was encoded by replacing each letter with its position in the English alphabet (A → 1, B → 2, …, Z → 26) and writing the numbers with no separators. Given the digit string code, return how many different messages could have produced it. No number starts with 0: "06" can't be read as F, and "0" on its own is not a letter.
code has 1 to 60 digits; return 0 when no message fits. Aim for one pass.
Besides the tests, one large input (a 30-digit code) with a ~200 ms limit (scaled to your device's speed): brute force won't pass.
Examples
count_readings("226")→3count_readings("11106")→2count_readings("06")→0