Recursion-Codes of the string

how to think about the recursive solution for this problem?

first think for len 1 and then for len 2 because there are only 26 alphabets.
Recursively call for single len and after returning from that call check for len 2 and call recursively for it.