Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
| 31 |
Tags
- 코딩테스트
- priorityqueue
- SQL
- DP
- 자바
- 투포인터
- dfs
- BOJ
- SWEA
- MySQL
- oracle
- 프로그래머스
- Java
- 시뮬레이션
- 백준
- 문제풀이
- db
- 알고리즘
- 문자열
- 러닝일지
- 이분탐색
- 문제해결
- 건강
- 운동기록
- greedy
- binary search
- math
- BFS
- COS PRO
- 코테
Archives
- Today
- Total
슈콩
[프로그래머스] Lv.2 2 x n 타일 본문


[문제]
https://school.programmers.co.kr/learn/courses/30/lessons/12900
프로그래머스
SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프
programmers.co.kr
[소스 코드]
class Solution {
public int solution(int n) {
int[] dp = new int[n+1];
dp[1] = 1;
dp[2] = 2;
for(int i=3;i<=n;i++){
dp[i] = (dp[i-1] + dp[i-2]) % 1000000007;
}
int answer = dp[n];
return answer;
}
}'Algorithms > Programmers' 카테고리의 다른 글
| [프로그래머스] Lv.2 두 큐 합 같게 만들기 (0) | 2025.10.17 |
|---|---|
| [프로그래머스] Lv.2 오픈채팅방 (0) | 2025.10.17 |
| [프로그래머스] Lv.2 주차 요금 계산 (0) | 2025.10.17 |
| [프로그래머스] Lv.2 숫자 변환하기 (0) | 2025.10.16 |
| [프로그래머스] Lv.2 스킬트리 (0) | 2025.10.16 |