We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe38abd commit 1fa60feCopy full SHA for 1fa60fe
2 files changed
프로그래머스/1/12943. 콜라츠 추측/README.md
@@ -1,10 +1,10 @@
1
# [level 1] 콜라츠 추측 - 12943
2
3
-[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/12943)
+[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/12943?language=java)
4
5
### 성능 요약
6
7
-메모리: 10.2 MB, 시간: 0.03 ms
+메모리: 73.6 MB, 시간: 0.02 ms
8
9
### 구분
10
@@ -16,7 +16,7 @@
16
17
### 제출 일자
18
19
-2024년 06월 26일 11:12:36
+2026년 06월 21일 15:04:00
20
21
### 문제 설명
22
프로그래머스/1/12943. 콜라츠 추측/콜라츠 추측.java
@@ -0,0 +1,12 @@
+class Solution {
+ public int solution(int num) {
+ int cnt = 0;
+ while (true) {
+ if (num == 1) return cnt;
+ if (cnt == 500) return -1;
+ if (num % 2 == 0) num /= 2;
+ else if (num % 2 == 1) num = num * 3 + 1;
+ cnt++;
+ }
11
12
+}
0 commit comments