def get_width(n: int) -> int:
    """Returns width of rangoli."""
    if n == 1:  # basecase
        return 1

    width = 0
    for i in range(n):
        if i == 0:      ## Middle char
            width += 3
        elif i < n-1:   ## Inter-rim chars
            width += 4
        elif i == n-1:  ## Bookend chars
            width += 2
    return width