본문으로 바로가기
728x90
반응형

문제

 

 

반응형

풀이

 

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
class Solution {
    public int solution(int[][] sizes) {
        int width = 0;
        int height = 0;
        for(int i=0; i<sizes.length; i++) {
            int max = Math.max(sizes[i][0], sizes[i][1]);
            int min = Math.min(sizes[i][0], sizes[i][1]);
            if(max>width) width = max;
            if(min>height) height = min;
        }
        return width*height;
    }
}
cs

 

728x90
반응형