Medium
Collatz Steps
Start from n. If it is even, halve it; if odd, make it 3n + 1. Count the steps until you reach 1.
Input
One integer n ≥ 1.
Output
The number of steps.
Sample 1
Input
6
Output
8
Sample 2
Input
1
Output
0
Output appears hereOne integer n ≥ 1.
The number of steps.
6
8
1
0
Output appears here