From 56195d6cdf8b35e0f27a316e217ee48e1571d39a Mon Sep 17 00:00:00 2001 From: rabbittee Date: Thu, 26 Aug 2021 03:34:29 +0000 Subject: [PATCH] create daily folder 2021-08-26 --- 2021-08/2021-08-26 (day39)/README.md | 57 ++++++++++++++++++++++++++++ README.md | 4 +- problem_list.log | 1 + 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 2021-08/2021-08-26 (day39)/README.md diff --git a/2021-08/2021-08-26 (day39)/README.md b/2021-08/2021-08-26 (day39)/README.md new file mode 100644 index 00000000..eaef5d1b --- /dev/null +++ b/2021-08/2021-08-26 (day39)/README.md @@ -0,0 +1,57 @@ +# 70. Climbing Stairs + +`Easy` + +## Description + +

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?

+ +

 

+

Example 1:

+ +
+Input: n = 2
+Output: 2
+Explanation: There are two ways to climb to the top.
+1. 1 step + 1 step
+2. 2 steps
+
+ +

Example 2:

+ +
+Input: n = 3
+Output: 3
+Explanation: There are three ways to climb to the top.
+1. 1 step + 1 step + 1 step
+2. 1 step + 2 steps
+3. 2 steps + 1 step
+
+ +

 

+

Constraints:

+ + + + +--- + +### Topic Tags + +[math]: https://img.shields.io/badge/-Math-EF9A9A +[dynamic-programming]: https://img.shields.io/badge/-Dynamic%20Programming-B39DDB +[memoization]: https://img.shields.io/badge/-Memoization-81D4FA + +![Math][math] + +![Dynamic Programming][dynamic-programming] + +![Memoization][memoization] + +--- + +##### [original question](https://leetcode.com/problems/climbing-stairs) diff --git a/README.md b/README.md index 52570b1d..acaafdb0 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ | 036 | [121][0121] | [Best Time to Buy and Sell Stock](<./2021-08/2021-08-23%20(day36)>) | ![Easy][Easy] | Array; Dynamic Programming | | 037 | [122][0122] | [Best Time to Buy and Sell Stock II](<./2021-08/2021-08-24%20(day37)>) | ![Easy][Easy] | Array; Dynamic Programming; Greedy | | 038 | [123][0123] | [Best Time to Buy and Sell Stock III](<./2021-08/2021-08-25%20(day38)>) | ![Hard][Hard] | Array; Dynamic Programming | +| 039 | [70][0070] | [Climbing Stairs](<./2021-08/2021-08-26%20(day39)>) | ![Easy][Easy] | Math; Dynamic Programming; Memoization | @@ -54,7 +55,7 @@ ### Summary -![](https://img.shields.io/badge/Easy-21-brightgreen) +![](https://img.shields.io/badge/Easy-22-brightgreen) ![](https://img.shields.io/badge/Medium-14-orange) @@ -81,6 +82,7 @@ [0048]: https://leetcode.com/problems/rotate-image/ [0049]: https://leetcode.com/problems/group-anagrams/ [0064]: https://leetcode.com/problems/minimum-path-sum/ +[0070]: https://leetcode.com/problems/climbing-stairs/ [0083]: https://leetcode.com/problems/remove-duplicates-from-sorted-list/ [0094]: https://leetcode.com/problems/binary-tree-inorder-traversal/ [0098]: https://leetcode.com/problems/validate-binary-search-tree/ diff --git a/problem_list.log b/problem_list.log index d4de710d..abeebbc0 100644 --- a/problem_list.log +++ b/problem_list.log @@ -37,3 +37,4 @@ 36,121,https://leetcode.com/problems/best-time-to-buy-and-sell-stock/,2021-08-23,Best Time to Buy and Sell Stock,Easy,Array;Dynamic Programming 37,122,https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/,2021-08-24,Best Time to Buy and Sell Stock II,Easy,Array;Dynamic Programming;Greedy 38,123,https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/,2021-08-25,Best Time to Buy and Sell Stock III,Hard,Array;Dynamic Programming +39,70,https://leetcode.com/problems/climbing-stairs/,2021-08-26,Climbing Stairs,Easy,Math;Dynamic Programming;Memoization