코딩 테스트/test_javaScript

[코딩테스트/javaScript] 최소직사각형

ijooha 2025. 1. 5. 11:04

function solution(sizes) {
    let sort = sizes.map(g => g.sort((a,b) => b-a));
    
    let first = Math.max(...sort.map(arr => arr[0]));
    let second = Math.max(...sort.map(arr => arr[1]));
    
    return first * second;
}