공부/코딩테스트

[프로그래머스] 카펫(파이썬)

ghhong 2022. 1. 13. 15:15

def solution(brown, yellow):
    j=0
    while(True):
        j+=1
        for i in range(1,5000):
            if 2*i+2*j-4==brown and (i-2)*(j-2)==yellow:
                return [i,j]