https://school.programmers.co.kr/learn/courses/30/lessons/42842
def solution(brown, yellow):
answer = []
size = brown + yellow # 전체 넓이
height = [] # 높이가 될 수 있는 값을 담음
for i in range(1, int(size**(1/2))+1): # 약수 구하기
if size%i==0:
height.append(i)
for i in range(len(height)):
if (height[i]-2)*((size//height[i])-2)==yellow:
# 가운데의 넓이가 yellow와 같다면 정답
answer=[size//height[i],height[i]]
break
return answer