Skip to content

Commit 35a81a5

Browse files
authored
Merge pull request #1229 from AlgorithmWithGod/LiiNi-coder
[20251025] PGM / LV2 / 카펫 / 이인희
2 parents f302129 + cfd71e4 commit 35a81a5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
```java
2+
class Solution {
3+
public int[] solution(int brown, int yellow) {
4+
int[] answer = new int[2];
5+
int area = brown + yellow;
6+
for(int r = area/3; r>=3; r--){
7+
if(area % r == 0){
8+
int c = area / r;
9+
System.out.println(r + "," + c);
10+
if(2*c + (r-2)*2 == brown){
11+
System.out.println("FIND");
12+
answer[0] = c;
13+
answer[1] = r;
14+
}
15+
}
16+
}
17+
return answer;
18+
}
19+
}
20+
```

0 commit comments

Comments
 (0)