------
## 最终结论
```python
def getMaxLen(nums):
    positive_length = 0
    negative_length = 0
    max_length = 0

    for num in nums:
        if num == 0:
            positive_length = 0
            negative_length = 0
        elif num > 0:
            positive_length += 1
            negative_length += 1 if negative_length > 0 else 0
        else:
            temp = positive_length
            positive_length = negative_length + 1 if negative_length > 0 else 0
            negative_length = temp + 1

        max_length = max(max_length, positive_length)

    return max_length

# Example usage:
nums1 = [1, -2, -3, 4]
print(getMaxLen(nums1)) # Output: 4

nums2 = [0, 1, -2, -3, -4]
print(getMaxLen(nums2)) # Output: 3

nums3 = [-1, -2, -3, 0, 1]
print(getMaxLen(nums3)) # Output: 2

nums4 = [-1, 2]
print(getMaxLen(nums4)) # Output: 1

nums5 = [1, 2, 3, 5, -6, 4, 0, 10]
print(getMaxLen(nums5)) # Output: 4
```