| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
Tags
- English
- Writing
- 괜찮음
- 영어원서읽기
- Daily Challenge
- 뭐든
- 미드시청
- 프로젝트
- leetcode
- Problem Solving
- 링피트
- 영어공부
- 개발자
- 30분
- 파비최
- 스탭퍼
- realclass
- 매일
- 만화도
- 10분
- FIT XR
- 리얼 클래스
- 쓰릴오브파이트
- 운동
- 3줄정리
- 잡생각
- 읽기
- 화상영어
- 사이드
- 월간
Archives
- Today
- Total
파비의 매일매일 공부기록
Today's Challenge 본문
https://leetcode.com/problems/climbing-stairs/
Climbing Stairs - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
완전 탐색이 가능한 문제 (N이 작음)
lru_cache라는걸 쓰면 효율이 좀 더 늘어나는 듯
class Solution:
@lru_cache(None)
def climbStairs(self, n: int) -> int:
return 1 if n < 2 else self.climbStairs(n-1) + self.climbStairs(n-2)반응형
'Problem Solving > LeetCode' 카테고리의 다른 글
| Today's Challenge (0) | 2022.12.14 |
|---|---|
| Today's Challenge (0) | 2022.12.13 |
| Today's Challenge (0) | 2022.12.09 |
| Today's Challenge (0) | 2022.12.08 |
| Today's Challenge (0) | 2022.12.07 |
Comments