def twoNumberSum_1(array, targetSum):
    """
    Space complexity: O(n) => using dictionary as hash table
    Time complexity: O(n) => only process the array list once
    """
    d = dict()
    for i, value in enumerate(array):
        remainder = targetSum - value
        if remainder in d:
            if value < remainder:
                return [value, remainder]
            else:
                return [remainder, value]
        else:
            d[value] = i
    # Not found
    return []