[HackerRank][Python3] Recursion: Fibonacci Numbers
2018. 7. 20. 23:01 |
프로그래밍/HackerRank
Problem :
https://www.hackerrank.com/challenges/ctci-fibonacci-numbers/problem
My Solution :
#!/usr/bin/env python3 def fibonacci(n): a, b = 0, 1 for i in range(2, n+1): a, b = b, a+b return b n = int(input()) print(fibonacci(n))
'프로그래밍 > HackerRank' 카테고리의 다른 글
[HackerRank][Python3] DFS: Connected Cell in a Grid (0) | 2018.07.21 |
---|---|
[HackerRank][Python3] Friend Circle Queries (0) | 2018.07.21 |
[HackerRank][Python3] Time Complexity: Primality (0) | 2018.07.21 |
[HackerRank][Python3] Recursion: Davis' Staircase (0) | 2018.07.21 |
[HackerRank][Python3] Tree: Huffman Decoding (0) | 2018.07.20 |
[HackerRank][Python3] Binary Search Tree : Lowest Common Ancestor (0) | 2018.07.20 |
[HackerRank][Python3] Balanced Brackets (0) | 2018.07.20 |
[HackerRank][Python3] Queues: A Tale of Two Stacks (0) | 2018.07.19 |
최근에 달린 댓글 최근에 달린 댓글