https://programmers.co.kr/learn/courses/30/lessons/42842
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
def solution(brown, red):
answer = []
for col in range(1, red+1):
if red % col == 0:
row = red // col
print(row,col)
if (row + 2) * (col + 2) - red == brown:
answer.append(row + 2)
answer.append(col + 2)
break
return answer
answer.append(row + 2)
answer.append(col + 2)
= answer.extend(row+2, col+2)
'알고리즘 > 프로그래머스(Python)' 카테고리의 다른 글
[알고리즘] 프로그래머스 방금그곡 / pyhton (0) | 2020.03.24 |
---|---|
[알고리즘] 프로그래머스 탑 / python (0) | 2020.03.21 |
[알고리즘] 프로그래머스 네트워크 / python, dfs (0) | 2020.03.19 |
[알고리즘] 프로그래머스 실패율 / python (0) | 2020.03.18 |
[알고리즘] 프로그래머스 오픈채팅방 / python (0) | 2020.03.16 |