HashSet
提取不重复的整数
http://www.nowcoder.com/questionTerminal/253986e66d114d378ae8de2e6c4577c1
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); Set<Character> set = new HashSet<>(); for(int i = s.length() - 1; i >= 0; i--) { if(set.add(s.charAt(i))) { System.out.print(s.charAt(i)); } } } }