Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 362 Bytes

README.md

File metadata and controls

11 lines (7 loc) · 362 Bytes

<< [07] Count the number of decodings for a message >>

Given the mapping a = 1, b = 2, ... z = 26, and an encoded message, count the number of ways it can be decoded.

Examples:

>>> coding_problem_07('111')  # possible interpretations: 'aaa', 'ka', 'ak'
3

>>> coding_problem_07('2626')  # 'zz', 'zbf', 'bfz', 'bfbf'
4