The Question
CodingClimbing Stairs Path Counting
You are climbing a staircase that takes n steps to reach the top. Each time you can either take 1 or 2 steps. Implement an optimal function in C++ to determine the total number of distinct ways you can reach the top, considering constraints where n can be up to 45 and efficiency in both time and space is required.
C++
DP
Fibonacci
Iterative