220v
젝무의 개발새발
220v
전체 방문자
오늘
어제
  • 분류 전체보기 (255)
    • AI (35)
      • ML, DL 학습 (30)
      • 논문 리뷰 (4)
      • 실습 및 프로젝트 (1)
    • Algorithm (145)
      • LeetCode (13)
      • 프로그래머스 (35)
      • 백준 (96)
      • 알고리즘, 문법 정리 (1)
    • Mobile, Application (17)
      • Flutter (10)
      • iOS, MacOS (7)
    • BackEnd (7)
      • Flask (1)
      • Node.js (5)
      • Spring, JSP..etc (1)
    • Web - FrontEnd (18)
      • JavaScript, JQuery, HTML, C.. (12)
      • React (6)
    • DataBase (1)
      • MySQL (1)
      • Firebase Firestore (0)
      • Supabase (0)
    • Git (1)
    • 기타 툴 및 오류 해결 (3)
    • 강의 (5)
      • Database (3)
      • 암호학 (2)
      • 알고리즘 (0)
    • 후기와 회고 (2)
    • 블로그 꾸미기 (1)
    • 일상과 이것저것 (20)
      • 맛집 (12)
      • 세상사는일 (4)
      • 도서리뷰 (1)
      • 이런저런 생각들 (잡글) (3)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • REACT
  • Prefix Sum
  • simulation
  • binary search
  • IMPLEMENT
  • Backtracking
  • Priority Queue
  • Greedy
  • BFS
  • Mathematics
  • bitmasking
  • 위상 정렬
  • Dynamic Programming
  • dfs
  • dp
  • brute-Force
  • implementation
  • disjoint set
  • 구현
  • 백준
  • 프로그래머스
  • 다익스트라
  • Lis
  • 오블완
  • two pointer
  • Minimum Spanning Tree
  • topological sort
  • 티스토리챌린지
  • top-down
  • union-find

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
220v
Algorithm/LeetCode

[LeetCode] 509. Fibonacci Number

Algorithm/LeetCode

[LeetCode] 509. Fibonacci Number

2022. 7. 6. 23:58

접근

얘는... 딱히 설명할 필요가 없을듯

기본적인 피보나치 수열 문제!

class Solution:
def fib(self, n: int) -> int:
num1 = 1
num2 = 1
temp = 0
if n == 0:
return 0
if n == 1 or n == 2:
return 1
for _ in range(n-2):
temp = num1 + num2
num1 = num2
num2 = temp
return num2
  • 접근
'Algorithm/LeetCode' 카테고리의 다른 글
  • [LeetCode] 1696. Jump Game VI
  • [LeetCode] 97. Interleaving String
  • [LeetCode/릿코드] 128. Longest Consecutive Sequence (220705 daily challenge)
  • [LeetCode/릿코드] 1710. Maximum Units on a Truck (220701 daily challenge)
220v
220v
DGU CSE 20 / Apple Developer Academy @ POSTECH 2nd Jr.Learner.

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.