Notes
This function is in beta test. Please help improve it in the issues
here.
Hints
Your answer may be identical to the JOJ answer in the first several lines.
However, you will still get Wrong Answer because the complete output may be longer and there might be errors in the future lines.
Please double check your code to solve this problem and try again.
Your Answer
Running tests for hailstone... Testing hailstone(5) Recursive: 5168421 Iterative: 5168421 Testing hailstone(8) Recursive: 8421 Iterative: 8421 Testing hailstone(14) Recursive: 147221134175226134020105168421 Iterative: 147221134175226134020105168421 Running tests for count_digits... Testing count_digits(2120, 2) Recursive: 2 Iterative: 2 Tail Recursive: 2 Testing count_digits(123, 7) Recursive: 0 Iterative: 0 Tail Recursive: 0 Testing count_digits(20, 0) Recursive: 1 Iterative: 1 Tail Recursive: 1 Testing count_digits(0, 8) Recursive: 0 Iterative: 0 Tail Recursive: 0 Testing count_digits(0, 0) Recursive: 0 Iterative: 0 Tail Recursive: 0
JOJ Answer
Running tests for hailstone... Testing hailstone(5) Recursive: 5 16 8 4 2 1 Iterative: 5 16 8 4 2 1 Testing hailstone(8) Recursive: 8 4 2 1 Iterative: 8 4 2 1 Testing hailstone(14) Recursive: 14 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 Iterative: 14 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 Running tests for count_digits... Testing count_digits(2120, 2) Recursive: 2 Iterative: 2 Tail Recursive: 2 Testing count_digits(123, 7) Recursive: 0 Iterative: 0 Tail Recursive: 0 Testing count_digits(20, 0) Recursive: 1 Iterative: 1 Tail Recursive: 1 Testing count_digits(0, 8) Recursive: 0 Iterative: 0 Tail Recursive: 0 Testing count_digits(0, 0) Recursive: 1 Iterative: 1 Tail Recursive: 1