mirror of
https://github.com/Xevion/exercism.git
synced 2025-12-06 15:15:01 -06:00
1 line
213 B
Python
1 line
213 B
Python
steps = lambda x, s=0 : exec(f'raise ValueError(\'Value \\\'{x}\\\' is not a valid Collatz Sequence starting point.\')') if x < 1 else s if x == 1 else steps(x // 2, s+1) if x % 2 == 0 else steps((3 * x) + 1, s+1) |