public static void main(String[] args) {
int[] x = { 1, 3, 4, 5, 6, 3, 2, 4, 6, 7, 9, 4, 12, 3, 4, 6, 8, 9, 7,
6, 4, 3, 2, 4, 7, 7, 5, 2, 1, 3, 4, 6, 3, 1, 1 };
int count = 1;
// System.out.print(x[i]+",");
for (int i = 0; i < 10 ; i++) {
for (int j = 0; j < x.length - 1; j++) {
if (x[j] == i) {
count++;
// System.out.println(x[i] + " " + i+" "+count);
}
}
System.out.println(i+"- Repeated " + count + " times");
count = 1;
}
}
[quote="qtpselenium.supp0rt@gmail.com":10i5u0lp]public static void main(String[] args) {
int[] x = { 1, 3, 4, 5, 6, 3, 2, 4, 6, 7, 9, 4, 12, 3, 4, 6, 8, 9, 7,
6, 4, 3, 2, 4, 7, 7, 5, 2, 1, 3, 4, 6, 3, 1, 1 };
int count = 1;
// System.out.print(x[i]+",");
for (int i = 0; i < 10 ; i++) {
for (int j = 0; j < x.length - 1; j++) {
if (x[j] == i) {
count++;
// System.out.println(x[i] + " " + i+" "+count);
}
}
System.out.println(i+"- Repeated " + count + " times");
count = 1;
}
}[/quote:10i5u0lp]
=============================
This solution gives provided output
0- Repeated 1 times
1- Repeated 4 times
2- Repeated 4 times
3- Repeated 7 times
4- Repeated 8 times
5- Repeated 3 times
6- Repeated 6 times
7- Repeated 5 times
8- Repeated 2 times
9- Repeated 3 times