public static void ExtractUniqueNumbers() { Scanner sc = new Scanner(System.in); int a= sc.nextInt(); Set<Integer> keys = new HashSet<>(); int res=0; while (a!=0){ int b=a%10; if(keys.add(b)){ res=res*10+b; } a=a/10; } System.out.println(res); }