Collatz Steps
Repeatedly apply: even N → N/2, odd N → 3N+1. Print the number of steps to reach 1.
Input: one integer N.
Output: the step count.
Constraints:
- 1 ≤ N ≤ 106
Sample Tests
Input 1
6
Output 1
8
Input 2
1
Output 2
0
Discussion (opens after you solve — no spoilers before)
No comments yet.