Skip to content

[최소직사각형] 좋아보이는 답안 #10

@OgDoYun

Description

@OgDoYun

좋아보이는 다른 사람의 풀이법

function solution(sizes) {
    const [hor, ver] = sizes.reduce(([h, v], [a, b]) => [Math.max(h, Math.max(a, b)), Math.max(v, Math.min(a, b))], [0, 0])
    return hor * ver;
}

무슨 말인지는 도통모르겠다. 하지만 이름만 잘 만든다면 볼 필요도 없이 정말 깔끔할 것 같다.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions