题解 | #提取不重复的整数#
提取不重复的整数
http://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String[] strs = scan.nextLine().trim().split("");
int[] acc = new int[10];
StringBuffer sb = new StringBuffer("");
for (int i = strs.length - 1; i > -1; i--) {
int num = ++acc[Integer.valueOf(strs[i])];
if (num <= 1) {
sb.append(strs[i]);
}
}
System.out.println(sb);
}
}