function solution(brown, yellow) {
let count = brown+yellow
for(let h = 3 ; h<=brown/2 ; h++){
if(count%h === 0) {
let w = count/h
if((w-2)*(h-2) === yellow){
return [w, h]
}
}
}
}
❗조건 충족 시 바로 return하기 때문에 세로가 가로 크기와 같거나 작다는 조건 고려하여 h로 for문을 돌리기
모두 통과!