Body: I want to create a method that that takes an Integer "k" and an "ArrayList of String" with a size n, and after, returns all combinations.
this is an example for n=3 (n is the size of the array) elements:
//ArrayList <String>list==> {ax,by,cz}
String solution="";
for(int k=1;k<=n;k++){
solution+=solution+function(k,list)//function(k,list) is the problem
}
String[] sol=solution.split();
//Solution expected:
//sol[0]=ax
//sol[1]=by
//sol[2]=cz
//sol[3]=axby "or" byax
//sol[4]=bycz "or" czby
//sol[5]=axcz "or" czax
//sol[6]=axbycz"or" any other combination of 3 elements for axbycz
