public static boolean containsDuplicates(int[] array) {
Set<Integer> set = new HashSet<>();
for(int item:array){
if (!set.add(item)) return true;
}
return false;
}
метод указанный мной удалит все буквы abcd efg и т.д. и отсортирует числа 1 и 32