Approach 1:
Iterate through all possible combinations, and check if the sum of combination is equal to target value, return index of two numbers.
Time complexity: O(). For each element, we try to find its complement by looping through the rest of the array which takes O(n) time. Therefore, the time complexity is O().
Approach 2:
Walk through all elements in the array, and use unordered_map to store the complement value of visited element, if the value is equal to the complement of any visited value, return the index of the two number.
Time Complexity: O(n). For each element, we check if any of visited value's complement is equal to it, since unordered_map is hashmap which takes O(1). Therefore, the time complexity is O(n).