728x90
반응형
class Solution {
public int solution(int n) {
for(int i=1; i<1000001; i++){
if(i*i == n){
return 1;
}
}
return 2;
}
}
728x90
반응형
'알고리즘 문제풀이 > Programmers - 자바' 카테고리의 다른 글
프로그래머스 - 암호 해독 (0) | 2023.03.04 |
---|---|
프로그래머스 - 가위 바위 보 (0) | 2023.03.03 |
프로그래머스 - 개미 군단 (0) | 2023.03.03 |
프로그래머스 - 모음 제거 (0) | 2023.03.03 |
프로그래머스 - 문자열안에 문자열 (0) | 2023.03.03 |