We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8739445 commit a12bf01Copy full SHA for a12bf01
minjeong/BruteForce/2024-05-06-[PGS]-#최소직사각형.py
@@ -0,0 +1,31 @@
1
+def solution(sizes):
2
+ widths = []
3
+ heights = []
4
+ for i in range(len(sizes)):
5
+ if sizes[i][0] >= sizes[i][1]:
6
+ widths.append(sizes[i][0])
7
+ heights.append(sizes[i][1])
8
+ else:
9
+ widths.append(sizes[i][1])
10
+ heights.append(sizes[i][0])
11
+ answer = max(widths) * max(heights)
12
+ return answer
13
+'''
14
+# 다른 코드 A
15
16
+ return max(max(x) for x in sizes) * max(min(x) for x in sizes)
17
+
18
19
20
21
+# 다른 코드 B
22
23
+ row = 0
24
+ col = 0
25
+ for a, b in sizes:
26
+ if a < b:
27
+ a, b = b, a
28
+ row = max(row, a)
29
+ col = max(col, b)
30
+ return row * col
31
0 commit comments