Skip to content

Instantly share code, notes, and snippets.

@jiffyclub
Created October 4, 2012 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jiffyclub/3831343 to your computer and use it in GitHub Desktop.
Save jiffyclub/3831343 to your computer and use it in GitHub Desktop.
Counting the number of ways to decode a string of numbers such as '123456' with a standard a = 1, b = 2, c = 3 encoding.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MysticHLE
Copy link

I too had the same intuition after examining the problem - and also couldn't figure out why it followed the Fib sequence. However, this post below sheds some light on the structure and pattern of the problem as to why it follows Fib.

http://www.geeksforgeeks.org/count-possible-decodings-given-digit-sequence/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment