def array_sign(nums: list[int]) -> int:
    """Computes the sign of the product of a given array of numbers

    Args:
        nums:

    Returns:
        1 if the product of nums is positive.
        -1 if the product of nums is negative.
        0 if the product of nums is equal to 0.

    Examples:
        >>> array_sign([-1,-2,-3,-4,3,2,1])
        1
        >>> array_sign([1,5,0,2,-3])
        0
        >>> array_sign([-1,1,-1,1,-1])
        -1

    """
    sign = 1
    for num in nums:
        if num == 0:
            return 0  # `product` will be 0 since 0 is a factor
        elif num < 0:
            sign *= -1
    else:
        return sign