Suppose A is represented by 1, B by 2 ...and Z by 26.
Now we are given a number, and we need to find number of possible decoding for this number. No need to consider number starts with zero.
Example: Input – 1234, Output – 3(ABCD, AWD, LCD)
How can we count Number of Non Leaf Nodes of a given Tree ?
Example 40 /\ / \ 20 60 / \ \ 10 30 80 \ 90
Answer => 4
Say the given string is ABC
ABC
Output should be ABC ACB BAC BCA CBA CAB
ACB
BAC
BCA
CBA
CAB
Convert the given string into palindrome with minimum number of appends(at end of the given string). O(n) algorithm will be appreciated ??
Input :=> Malayal Output :=> Malayalam