My LeetCode grinding. Trying to do a problem a day.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

problem.txt 482B

123456789101112131415161718192021222324
  1. You are climbing a stair case. It takes n steps to reach to the top.
  2. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
  3. Note: Given n will be a positive integer.
  4. Example 1:
  5. Input: 2
  6. Output: 2
  7. Explanation: There are two ways to climb to the top.
  8. 1. 1 step + 1 step
  9. 2. 2 steps
  10. Example 2:
  11. Input: 3
  12. Output: 3
  13. Explanation: There are three ways to climb to the top.
  14. 1. 1 step + 1 step + 1 step
  15. 2. 1 step + 2 steps
  16. 3. 2 steps + 1 step