Skip to content

Latest commit

 

History

History
15 lines (15 loc) · 350 Bytes

README.md

File metadata and controls

15 lines (15 loc) · 350 Bytes

Climbing Stairs

This problem is easy to solve by recursive like below:

class Solution(object):
    def climbStairs(self, n):
        """
        :type n: int
        :rtype: int
        """
        if n == 1:
            return 1
        if n == 2:
            return 2
        return self.climbStairs(n - 1) + self.climbStairs(n - 2)