New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Day 7 #15
Comments
Hi Vaskoz! I believe your solution will fail on "1111127". It should expect 13 which consist of the following: |
Hi @charlieysc ! I added your testcase to my "day 7" tests with this commit and the test appears to pass on your testcase with the code as-is. Separately, I also rewrote my solution to make it easier to read. My previous solution processed the input from the back. My new solution processes the input from the front. The simplification also resulted in a small speedup.
AFTER:
|
Whoops! Mistake on my part. Yes, your solution works as-is. |
Good morning! Here's your coding interview problem for today.
This problem was asked by Facebook.
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.
The text was updated successfully, but these errors were encountered: