We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff0ac61 commit 019e871Copy full SHA for 019e871
프로그래머스/1/86491. 최소직사각형/README.md
@@ -4,7 +4,7 @@
4
5
### 성능 요약
6
7
-메모리: 9.79 MB, 시간: 2.50 ms
+메모리: 10.4 MB, 시간: 0.74 ms
8
9
### 구분
10
@@ -16,7 +16,7 @@
16
17
### 제출 일자
18
19
-2026년 01월 05일 14:08:28
+2026년 01월 05일 14:10:32
20
21
### 문제 설명
22
프로그래머스/1/86491. 최소직사각형/최소직사각형.py
@@ -1,8 +1,8 @@
1
def solution(sizes):
2
- l, w = 0, 0
3
- for i in range(len(sizes)):
- if sizes[i][0] < sizes[i][1]:
- sizes[i][0], sizes[i][1] = sizes[i][1], sizes[i][0]
- if sizes[i][0] > l: l = sizes[i][0]
- if sizes[i][1] > w: w = sizes[i][1]
- return l*w
+ length, width = 0, 0
+ for a, b in sizes:
+ if a < b:
+ a, b = b, a
+ if a > length: length = a
+ if b > width: width = b
+ return length * width
0 commit comments