def two_sum(arr, target):
    """Function takes in two args, the input array
    and the target.
        T: O(n) - We loop through the array once
        S: O(n) - We use an extra data structure to store the target-curr
    :param arr: Input array
    :param target: Target
    :return: list of two numbers, else empty arr
    """
    n = len(arr)
    res = []
    if n == 0 or n == 1:
        return res
    sum_dict = {}
    for i in range(n):
        curr_diff = target-arr[i]
        sum_dict[curr_diff] = i
        if arr[i] in sum_dict and sum_dict[arr[i]]!=i:
            res += [arr[i], curr_diff]
            break
    return res