문제접근
•
가로, 세로를 신경쓰지 말고 한 곳은 최대 길이, 한 곳은 남은 길이 선택
놓쳤던 부분
코드
KB
ms
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<vector<int>> sizes) {
    int answer = 0;
    int w = 0, h = 0;
    
    for (int i = 0; i < sizes.size(); i++)
    {
        w = max(w, max(sizes[i][0], sizes[i][1]));
        h = max(h, min(sizes[i][0], sizes[i][1]));
    }
    answer = w * h;
    return answer;
}
C++
복사

