Staircase no double steps

Write codeMedium14 min

Your task

You climb a staircase of n steps using moves of 1 or 2 steps. A 2-step move is tiring, so you may never make two 2-step moves in a row, every 2-step must be followed by a 1-step (or be the final move). Return the number of distinct move sequences that end exactly on step n. For n = 0 return 1. For example, n = 4 has 4 sequences: 1111, 112, 121, 211 (22 is forbidden).

Examples

count_paced_climbs(n: int) -> int
Example 1
Inputcount_paced_climbs(4)
Output4
Example 2
Inputcount_paced_climbs(5)
Output6