For example, given the array [1, 2, 3, 4, 5] with a target sum of 7, we can approach the problem as follows: We start by creating an empty hash table named numHash . Next, we iterate through the array. For each element, we determine if targetSum - number is a key in numHash . If it is not present, we insert the current number into numHash with its index as the associated value. If it is present, we have identified our pair: the current number and targetSum - number . In this situation, the numbers that add up to 7 are 2 and 5. Here’s a Python code example illustrating this solution: def twoSum ( array , targetSum ) : numHash = { } for i in range ( len ( array ) ) : num = array [ i ] complement = targetSum - num if complement in numHash : return [ complement , num ] else : numHash [ num ] = i return None