Given a string of integers how to find out all the possible words that can made out of it in continuous order. Eg: 11112
ans: AAAAB AKAB AAKB AAAL etc.
public static void main(String[] args) {
String str="11111124";
char strChar[]=str.toCharArray();
String target="";
for(int i=0;i<strChar.length;i++)
{
target=target+(char)Integer.parseInt(""+(16+strChar[i]));
}
System.out.println(target);
}
i am trying to find the solution for this but not able to find all combination
Combining the comments saying that
163
can be1,6,3
or16,3
, but not1,63
, and user3437460's suggestion of using recursion:<=26
, convert to letter and make recursive call using letter and remaining digits.Here is the code. Since I have no clue what to call the method, I'm going with
x
.Output