https://school.programmers.co.kr/learn/courses/30/lessons/120848
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
class Solution {
private static final int INF = 3_628_800;
public int solution(int n) {
int answer = cal(n);
return answer;
}
private int cal(int num){
int result = 1;
int temp = 1;
for(int i = 1 ; i <= 10 ; i++){
temp *= i;
if(temp <= num){
result = i;
}else{
break;
}
}
return result;
}
}
'알고리즘' 카테고리의 다른 글
프로그래머스 배열의 유사도 (JAVA) (0) | 2022.11.30 |
---|---|
프로그래머스 한 번만 등장한 문자 (JAVA) (0) | 2022.11.29 |
프로그래머스 인덱스 바꾸기 (JAVA) (0) | 2022.11.27 |
프로그래머스 머쓱이보다 키 큰 사람(JAVA) (0) | 2022.11.26 |
프로그래머스 짝수 홀수 개수 (JAVA) (0) | 2022.11.24 |