CODES
some learning from problems.
CODES
some learning from problems.
Showing posts with label
Decoding
.
Show all posts
Showing posts with label
Decoding
.
Show all posts
Wednesday, 4 July 2012
The character 'a' to 'z' are encoded as 1 - 26. Given a string of digits, compute the number of valid decodings of the string. For example, both 'aa' and 'k' can be encoded as '11'. Hence num_valid_encodings('11') = 2.
›
recursive #include <stdio.h> #include <string.h> int count_decode(char S[10],int n) { int x1=S[n-1]-'0',x2...
2 comments:
›
Home
View web version