Given a positive integer n, return the number of steps required to reduce it to 1. If n is even, divide it by 2 (n = n / 2). If n is odd, multiply it by 3 and add 1 (n = 3n + 1).
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.