We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4daa163 + de1bb07 commit cfcda34Copy full SHA for cfcda34
0224LJH/202512/17 PGM 카펫.md
@@ -0,0 +1,28 @@
1
+```java
2
+import java.io.*;
3
+import java.util.*;
4
+
5
+class Solution {
6
+ public int[] solution(int brown, int yellow) {
7
+ int len = brown+4;
8
+ int half = len/2;
9
+ int ans1 = -1;
10
+ int ans2 = -1;
11
+ int[] answer = new int[2];
12
13
+ for (int width = half-3; width >= 3 ; width--){
14
+ int height = half-width;
15
+ int temp = 0;
16
+ if ((width-2)*(height-2) == yellow){
17
+ answer[0] = width;
18
+ answer[1] = height;
19
+ return answer;
20
+ }
21
22
23
24
25
26
27
+}
28
+```
0 commit comments