def solution(brown, yellow):
total,answer = brown+yellow, []
for d in range(1,int(total**0.5)+1):
if total%d==0 and int((total//d-2)*(d-2))==yellow:
answer.append(int(total//d))
answer.append(int(d))
return answer
'프로그래머스 > [코테]Level2' 카테고리의 다른 글
[Python] 구명보트 (0) | 2020.11.06 |
---|---|
[Python] 문자열 압축 (0) | 2020.10.24 |
[Python] 큰 수 만들기 (0) | 2020.10.23 |
[Python] 주식가격 (0) | 2020.10.23 |
[Python] 위장 (0) | 2020.10.23 |