def arraySubtraction(leftArray, rightArray):
    """Performs piece-wise subtraction of elements in two input arrays.
    
    leftArray, rightArray -- the two arrays to perform the subtraction. For the purposes of recursion, these are also allowed to be scalars.
    
    Returns leftArray - rightArray
    """
    if isinstance(leftArray, list):
        return [arraySubtraction(*arrayItems) for arrayItems in zip(leftArray, rightArray)]
    else:
        return leftArray - rightArray