package leetcode;

/**
 * https://leetcode.com/problems/reach-a-number/
 */
public class Problem754 {
    public int reachNumber(int target) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem754 prob = new Problem754();
        System.out.println(prob.reachNumber(3)); // 2
        System.out.println(prob.reachNumber(2)); // 3
    }
}

package leetcode;

/**
 * https://leetcode.com/problems/reach-a-number/
 */
public class Problem754 {
    public int reachNumber(int target) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem754 prob = new Problem754();
        System.out.println(prob.reachNumber(1)); // 1
        System.out.println(prob.reachNumber(2)); // 3
        System.out.println(prob.reachNumber(3)); // 2
        System.out.println(prob.reachNumber(4)); // 3
        System.out.println(prob.reachNumber(5)); // 5
        System.out.println(prob.reachNumber(6)); // 3
        System.out.println(prob.reachNumber(7)); // 5
        System.out.println(prob.reachNumber(8)); // 4
        System.out.println(prob.reachNumber(9)); // 5
    }
}

Update problem 754