class Solution:
    def climbStairs(self, n: int) -> int:
        ways = [0]*(n)
        if n == 1: return 1
        ways[0] = 1
        ways[1] = 2
        for i in range(2,n):
            ways[i] = ways[i-1]+ways[i-2]
        return ways[-1]
        
36b78163680ac26a51103401b4ead44919bb714f
<mask token>

class Solution:
    <mask token>

class Solution:

    def climbStairs(self, n: int) ->int:
        ways = [0] * n
        if n == 1:
            return 1
        ways[0] = 1
        ways[1] = 2
        for i in range(2, n):
            ways[i] = ways[i - 1] + ways[i - 2]
        return ways[-1]

class Solution:
    def climbStairs(self, n: int) -> int:
        ways = [0]*(n)
        if n == 1: return 1
        ways[0] = 1
        ways[1] = 2
        for i in range(2,n):
            ways[i] = ways[i-1]+ways[i-2]
        return ways[-1]
        