public class FindUniqueDigitsNumber {
public static void main(String args[]) {
int l = 10;
int r = 30;
findUniqueDigitNumber(l, r);
}
static void findUniqueDigitNumber(int l, int r){
for(int i=l;i<=r;i++) {
boolean[] boo = new boolean[100];
int num = i;
while(num!=0) {
if(boo[num%10]) {
break;
}
boo[num%10] = true;
num = num/10;
}
if(num==0)
{
System.out.println(i);
}
}
}
}
output(11 and 22 missing):
10
12
13
14
15
16
17
18
19
20
21
23
24
25
26
27
28
29
30
No comments:
Post a Comment