def bottom_up(num_steps: int) -> int:
    """Compute number of steps using a bottom up approach

    This iterative appraoch is the best approach. Since it avoids the max
    recursion depth and uses O(1) space. Actually, the space complexity is more
    complicated. We only use 3 ints but the space needed by those 3 ints grows
    as n grows. I guess it actually uses O(log(n)) space?

    Args:
        num_steps: number of total steps

    Returns:
        The number of possible ways to climb the stairs
    """
    if num_steps <= 2:
        return num_steps
    if num_steps == 3:
        return 4
    a = 1
    b = 2
    c = 4
    for _ in range(4, num_steps):
        a, b, c = b, c, a + b + c
    return a + b + c