점점 속도가 붙고 있다. 무식한게 딱 내스타일이다.
class Solution {
public int[] solution(int brown, int red) {
int[] answer = new int[2];
answer[0]=1;answer[1]=1;
for(int i=3;i<10000;i++)
for (int j=3; j<10000;j++)
if(i*j==(brown+red)){
if((i-2)*(j-2)==red){
System.out.println("i is "+i);
System.out.println("j is "+j);
answer[0]=i;
answer[1]=j;
break;
}
}
return answer;
}
}