Java (132) ==== boolean unique(int n){ int[] p=new int[]{2,3,5,7,11,13,17,19,32,29};//list of 10 first primes double a=9001312320D;//10 first primes multiplied while(n>0){ a/=p[n%10];//divide by (n%10+1)th prime n/=10;//divide n by 10, next digit } return (long)a==a;//if a is integer then n has all digits unique } or boolean u(int n){int[] p=new int[]{2,3,5,7,11,13,17,19,32,29};double a=9001312320D;while(n>0){a/=p[n%10];n/=10;}return (long)a==a;}