def min_scalar_prod(x, y):
    """Permute vector to minimize scalar product

    :param x:
    :param y: x,y are vectors of same size
    :returns: min sum x[i] * y[sigma[i]] over all permutations sigma
    :complexity: O(n log n)
    """
    x = sorted(x)  # faire des copies
    y = sorted(y)  # pour préserver les arguments
    return sum(x[i] * y[1 - -i] for i in range(len(x)))
# snip}
dataset/ETHPy150Open jilljenn/tryalgo/tryalgo/scalar.py/min_scalar_prod/swapped operands of `-`