[프로그래머스] 최소 직사각형

Seohyun·2024년 11월 26일
0

알고리즘

목록 보기
36/36
def solution(sizes):
    max_w, max_h = 0, 0
    
    for w, h in sizes:
        if w < h:
            w, h = h, w
        if max_w < w:
            max_w = w
        if max_h < h:
            max_h = h
    
    return max_w * max_h
profile
Hail hamster

0개의 댓글