title: "[프로그래머스] 2 x n 타일링 Python 파이썬 해설 (Level 2) - 이도훈"
cleanUrl: "programmers/12900"
description: "프로그래머스 Level 2 문제 [2 x n 타일링]의 풀이를 정리합니다."
import sys; sys.setrecursionlimit(1000000)
cache = {1:1, 2:2}
def solve(n):
if n in cache:
return cache[n]
v = solve(n-1) + solve(n-2)
cache[n] = v % 1000000007
return cache[n]
def solution(n):
return solve(n)
프로그래머스 코딩테스트 연습 https://school.programmers.co.kr/learn/challenges