def sum_range(a: int, b: int, /) -> int:
    if a > b:
        a, b = b, a
    return sum(range(a, b))