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