728x90

https://programmers.co.kr/learn/courses/30/lessons/86491

출처 : 프로그래머스

 

코딩테스트 연습 - 최소직사각형

[[10, 7], [12, 3], [8, 15], [14, 7], [5, 15]] 120 [[14, 4], [19, 6], [6, 16], [18, 7], [7, 11]] 133

programmers.co.kr


def solution(sizes):
    answer = 0
    w = max(max(x) for x in sizes)
    h = max(min(x) for x in sizes)
    answer = w*h
    return answer

 

+ Recent posts