
Given array: int[] dimension = { 1, 2, 3 };
That produces the output: 1 2 3 12 13 23 123
I'm new to array...i can't figure out the way on even how to start... any idea?...really appreaciate if someone could help...thanks!

import java.util.*;
class Example{
static ArrayList list = new ArrayList();
public static void generate(String str){
list.add(str);
if (str.length() == 1){
list.add(str);
return;
}
for (int i = 0; i < str.length(); i++){
generate(str.substring(0,i) + str.substring(i+1));
}
}
public static void main(String args[])
{
int arr[]={1,2,3};
String st ="";
for(int i=0;i<arr.length;i++){
st+=Integer.toString(arr[i]);
}
generate(st);
HashSet set=new HashSet(list);
ArrayList l=new ArrayList(set);
for(int i=l.size()-1;i>=0;i--){
System.out.println(l.get(i));
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.