filmov
tv
Climbing Stairs Problem | dynamic programming | Python | Coding interview question

Показать описание
You are climbing a staircase. It takes n steps to reach the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
We solve this problem using dynamic programming.
Discussed two approaches for memoization - one is the built-in python lru_cache and another one is using our own dictionary as memory
#leetcode 70
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
We solve this problem using dynamic programming.
Discussed two approaches for memoization - one is the built-in python lru_cache and another one is using our own dictionary as memory
#leetcode 70