use HashMap to find pairs whose sum is target