from typing import List


def reconstruct(nums: List[str]) -> List[int]:
    """
    Let's assume first number to be 0.
    Let's set max_num = min_num = 0.
    Everytime we encounter a +, we increment max_num and append it.
    Everytime we encounter a -, we decrement min_num and append it.
    Finally, iterate over the list again and add min_num to all.
    """
    max_num = min_num = 0
    size = len(nums)
    res = [0] * size

    for index in range(1, size):
        if nums[index] == "+":
            max_num += 1
            res[index] = max_num
        if nums[index] == "-":
            min_num -= 1
            res[index] = min_num

    return [num - min_num for num in res]