Coding Problem 2
Decode number to string asked by facebook Ques. Given any number you have to find the number of ways to decode the number like if you are given the number 12 then it can be decode as "ab" where a=1 and b=2 and "l" where l=12 so the total number of ways to decoed 12 is 2 as "ab" and "l". Solution. We can map our alphabets to the number from 1 to 26. If we have empty string or a single digit number then we can have only one way to decode it but for two or more than 2 digit numbe we have to check each number plus the pair of numbers. Now here we can simplify it as we can have number from 0 to 9 and we have to check only those pair of numbers which are less than 27 as we have 26 alphabets only. Suppose we have input as "4" then we can decode it...