题解 | #提取不重复的整数#
提取不重复的整数
http://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
import java.util.HashSet;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String num = scanner.nextLine();
int len = num.length();
HashSet<Character> set = new HashSet<>();
for (int i=len-1; i>=0; i--) {
char c = num.charAt(i);
if (!set.contains(c)) {
set.add(c);
System.out.print(c);
}
}
}
}