Skip to content

Commit 019e871

Browse files
committed
[level 1] Title: 최소직사각형, Time: 0.74 ms, Memory: 10.4 MB -BaekjoonHub
1 parent ff0ac61 commit 019e871

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

프로그래머스/1/86491. 최소직사각형/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### 성능 요약
66

7-
메모리: 9.79 MB, 시간: 2.50 ms
7+
메모리: 10.4 MB, 시간: 0.74 ms
88

99
### 구분
1010

@@ -16,7 +16,7 @@
1616

1717
### 제출 일자
1818

19-
2026년 01월 05일 14:08:28
19+
2026년 01월 05일 14:10:32
2020

2121
### 문제 설명
2222

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
def solution(sizes):
2-
l, w = 0, 0
3-
for i in range(len(sizes)):
4-
if sizes[i][0] < sizes[i][1]:
5-
sizes[i][0], sizes[i][1] = sizes[i][1], sizes[i][0]
6-
if sizes[i][0] > l: l = sizes[i][0]
7-
if sizes[i][1] > w: w = sizes[i][1]
8-
return l*w
2+
length, width = 0, 0
3+
for a, b in sizes:
4+
if a < b:
5+
a, b = b, a
6+
if a > length: length = a
7+
if b > width: width = b
8+
return length * width

0 commit comments

Comments
 (0)