Imagine you are on an Easter-themed adventure this April 7, 2025. You are given a staircase with n steps numbered from 1 to n. Some of these steps are broken (represented as a list of integers). Your goal is to count the number of distinct ways to reach the top (step n) starting from step 1, under the following rules:
For instance, if n = 5 and broken_steps = [3], then the valid sequence could be:
There might be other sequences, but any path that steps on 3 must be disregarded. Use a dynamic programming approach to count all valid ways.
Hint: Think about how you can utilize the results of previous steps (subproblems) to compute the result for the current step.
Good luck!