NewThe Learning module is now liveSee what's new

(This question is a variation of the LeetCode question 397. Integer Replacement . If you haven't completed that question yet, it is recommended to solve it first.)

You are given a positive integer n. Your task is to reduce this number to zero using as few steps as possible.

Test Cases
Input
Output
Expected