题解 | #提取不重复的整数#
提取不重复的整数
http://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
HashSet<Integer> hs = new HashSet<>();
String str = sc.next();
for (int i = str.length() - 1; i >= 0; i--) {
int n = Integer.parseInt(String.valueOf(str.charAt(i)));
if(hs.add(n)){
System.out.print(n);
}
}
}
}