Given a staircase with n
steps, find the number of distinct ways to climb to the top if you can:
Constraints:
Examples:
// Example 1: console.log(climbStairs(2)); // Output: 2 // Explanation: Two ways to climb: // 1. 1 step + 1 step // 2. 2 steps // Example 2: console.log(climbStairs(3)); // Output: 3 // Explanation: Three ways to climb: // 1. 1 step + 1 step + 1 step // 2. 1 step + 2 steps // 3. 2 steps + 1 step