99클럽 코테 스터디 11일차 TIL + 최소직사각형

Saang Bum Kim·2024년 5월 2일
0

99클럽

목록 보기
25/59

문제

링크텍스트

풀이

  • 가로 세로 보다는 최대/최소로 하면 쉽게 풀린다.

결과

def solution(sizes):
    x = 0
    y = 0
    n = len(sizes)
    for i in range(n):
        xi = min(sizes[i])
        yi = max(sizes[i])
        x = max(x,xi)
        y = max(y,yi)
    
    answer = x*y
    return answer

profile
old engineer

0개의 댓글