for (int i = 0; i < arr.length; i++) {
for (int j = i +1; j < arr.length; j++) {
sum = arr[i] + arr[j];
if (hashMap.containsKey(sum)){
hashMap.put(sum, hashMap.get(sum) + 1);
} else {
hashMap.put(sum, 1);
}
count++;
//System.out.println("Числа: " + arr[i] + " + " + arr[j] + " = " + sum);
}
}
for (Map.Entry entry : hashMap.entrySet()) {
if (entry.getValue().equals(1))
{
System.out.println("Key: " + entry.getKey() + " Value: "
+ entry.getValue());
}
}