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
- DP
- 문자열
- 문제풀이
- Java
- greedy
- 이분탐색
- 백준
- 코테
- BOJ
- BFS
- 자바
- db
- dfs
- 건강
- SWEA
- COS PRO
- 러닝일지
- binary search
- 문제해결
- 프로그래머스
- SQL
- 투포인터
- MySQL
- oracle
- 시뮬레이션
- 운동기록
- 알고리즘
- math
- 코딩테스트
- priorityqueue
Archives
- Today
- Total
슈콩
[프로그래머스] 최소직사각형 본문


[문제]
https://school.programmers.co.kr/learn/courses/30/lessons/86491#qna
프로그래머스
SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프
programmers.co.kr
[소스 코드]
class Solution {
public int solution(int[][] sizes) {
int answer = 0;
int row = 0;
int col = 0;
for(int i=0;i<sizes.length;i++){
int w = Math.min(sizes[i][0],sizes[i][1]);
int h = Math.max(sizes[i][0],sizes[i][1]);
row = Math.max(w,row);
col = Math.max(h,col);
}
answer = row * col;
return answer;
}
}'Algorithms > Programmers' 카테고리의 다른 글
| [프로그래머스] Lv.1 없는 숫자 더하기 (0) | 2026.04.06 |
|---|---|
| [프로그래머스] 약수의 합 (0) | 2025.11.08 |
| [프로그래머스] 나머지 1이 되는 수 찾기 (0) | 2025.10.26 |
| [프로그래머스] x만큼 간격이 있는 n개의 숫자 (0) | 2025.10.25 |
| [프로그래머스] 평균 구하기 (0) | 2025.10.25 |