Hey there coder!

Got another coding interview test problem for you today Can you decode the hidden messages? Write your answer in a gist or pastebin and link it in the comments below!

Difficulty: Medium

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

For example, the message ‘111’ would give 3, since it could be decoded as ‘aaa’, ‘ka’, and ‘ak’.

You can assume that the messages are decodable. For example, ‘001’ is not allowed.

What’s your Answer?