We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 37c6d16 + 7538cec commit 8848a76Copy full SHA for 8848a76
Week4/공통/최소직사각형/jiyoon.java
@@ -0,0 +1,19 @@
1
+package Week4.공통.최소직사각형;
2
+
3
+public class jiyoon {
4
+ class Solution {
5
+ public int solution(int[][] sizes) {
6
+ int max_width = 0;
7
+ int max_height = 0;
8
9
+ for (int i = 0; i < sizes.length; i++) {
10
+ int width = Math.min(sizes[i][0], sizes[i][1]); // 너비를 명함의 최솟값으로 설정
11
+ int height = Math.max(sizes[i][0], sizes[i][1]); // 높이를 명함의 최댓값으로 설정
12
+ max_width = Math.max(max_width, width);
13
+ max_height = Math.max(max_height, height);
14
+ }
15
16
+ return max_width * max_height;
17
18
19
+}
0 commit comments