def twoNumberSum(array : list, targetSum : int) -> list:
    """Finds the two numbers in the array needed to get targetSum
    This solution has O(n) time complexity | O(n) space complexity

    Args:
        array: A list containing all the candidate numbers
        targetSum: The target number we want to get by adding two numbers from the array

    Returns:
        A list containing the two numbers that added give targetSum as a result
    """
    sum = []
    diff = []
    for e in array:
        if e in diff:
            sum.append(e)
            sum.append(array[diff.index(e)])
            break
        else:
            diff.append(targetSum - e)
    return sum