uploaded at 2022. 12. 8. 오후 5:52:45

This commit is contained in:
rl544
2022-12-08 17:52:46 +09:00
parent 6b8c2bf038
commit 488bead356
@@ -0,0 +1,14 @@
// [문제 링크]: https://school.programmers.co.kr/learn/courses/30/lessons/87389
class Solution {
public int solution(int n) {
int answer = 0;
for (int i = 1; i < n; i++){
if(n%i==1){
answer = i;
break;
}
}
return answer;
}
}