brown | yellow | return |
---|---|---|
10 | 2 | [4, 3] |
8 | 1 | [3, 3] |
24 | 24 | [8, 6] |
구하려는 값을 x, y라고 할 때,
- 2(x-2) + 2(y-2) + 4 = brown
- x*y = brown+yellow
def solution(brown, yellow):
answer = []
for x in range(3, 2503):
for y in range(3, 2503):
if x*y == brown+yellow and 2*x+2*y-4==brown:
answer.append(y)
answer.append(x)
return answer