Last updated 4 years ago
Was this helpful?
const hotpo = (n, count = 0) => { if (n === 1) { return count; } return n % 2 === 1 ? hotpo(3 * n + 1, count + 1) : hotpo(n / 2, count + 1); };