Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def solve(self, n):
- count = 1
- while n != 1:
- if n % 2:
- n = 3 * n + 1
- else:
- n = n / 2
- count += 1
- return count
Advertisement
RAW Paste Data
Copied
Advertisement