An Equinix Metal provisioning workflow advances through n ordered stages. Each transition may advance by exactly 1 or 2 stages. Given n, return every distinct ordered sequence of moves that reaches stage n exactly.
Sequences are permutations by order, so [1, 2] and [2, 1] are different when both are valid. Return the results in depth-first order, trying a 1-step move before a 2-step move. For n = 0, return [[]], representing the one valid sequence containing no moves.
Implement stair_paths(n):
n, representing the destination stair.1 and 2, and its values sum to n.def stair_paths(n):