Input array is sorted:
Use binary search or two pointers
Unsorted:
Use hash map, key = target - a[i], value = a[i]
Search and find containsKey
Input array is sorted:
Use binary search or two pointers
Unsorted:
Use hash map, key = target - a[i], value = a[i]
Search and find containsKey