Skip to content

Commit ff0ac61

Browse files
committed
[level 1] Title: 최소직사각형, Time: 2.50 ms, Memory: 9.79 MB -BaekjoonHub
1 parent 4b0980c commit ff0ac61

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
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-
메모리: 11.3 MB, 시간: 7.54 ms
7+
메모리: 9.79 MB, 시간: 2.50 ms
88

99
### 구분
1010

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

1717
### 제출 일자
1818

19-
2024년 07월 06일 15:28:23
19+
2026년 01월 05일 14:08:28
2020

2121
### 문제 설명
2222

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

0 commit comments

Comments
 (0)