After looking at the common stair climbing problem, I started to wonder if this could be abstracted to a function that allows for the entry of both number of stairs and the max increment steps allowed as parameters.
I would like to be able to write a function with this signature. If max_step_increment
is 4, that means the stair-climber could takes steps of 1, 2, 3, or 4 at a time.
def stair_paths(num_steps, max_step_increment):
...
return answer
I would call this function like stair_paths(10, 4)
.