public class Main {
public static void main(String[] args) {
String word="AskdaS";
Polymers(word);
}
static void Polymers(String polymers){
String help="";
for (int i = 0; i < polymers.length(); i++) {
char ch= polymers.charAt(i);
if (polymers.indexOf(ch)==polymers.lastIndexOf(ch)){
help+=ch;
}
}
System.out.println(help);
}
}
Подробнее здесь: https://stackoverflow.com/questions/794 ... -case-inpu