//Write a program that, given an array A[] of n numbers and another number x, determines whether or not there exist two elements in S whose sum is exactly x.
public class PairsInAnArray {
boolean findPair(List<Integer> list, int x) {
int count =0;
//{1, 4, 45, 6, 10, -8} and sum to find be 16
HashSet visited = new HashSet();
for (int i = 0; i < list.size(); i++) {