Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

<< [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