package leetcode;

/**
 * https://leetcode.com/problems/number-of-steps-to-reduce-a-number-to-zero/
 */
public class Problem1342 {
    public int numberOfSteps (int num) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1342 prob = new Problem1342();
        System.out.println(prob.numberOfSteps(14)); // 16
        System.out.println(prob.numberOfSteps(8)); // 4
        System.out.println(prob.numberOfSteps(123)); // 12
    }
}

@@ -177,304 +177,233 @@
     
-// TODO%0A        return 0
+int answer = 0;%0A        int n = num
 ;%0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem1342 prob = new Problem1342();%0A        System.out.println(prob.numberOfSteps(14)); // 16%0A        System.out.println(prob.numberOfSteps(8)); // 4%0A        System.out.println(prob.numberOfSteps(123)); // 12
+while (n %3E 0) %7B%0A            if (n %25 2 == 0) %7B%0A                n /= 2;%0A            %7D else %7B%0A                n--;%0A            %7D%0A            answer++;%0A        %7D%0A        return answer;
 %0A   

Solve problem 1342