r/codinginterview • u/bparanj • Jun 22 '20
Key to Understanding the Solution to Number of Encodings
This Facebook coding question is a bit tricky. The empty string returns one even though only characters a through z are mapped from 1 through 26. The reason for the empty string base case returning 1 is that we have to count all the characters as one combination. This took me a couple of days to understand.
0
Upvotes