@@ -0,0 +1,930 @@
+package leetcode;%0A%0A/**%0A * https://leetcode.com/problems/guess-number-higher-or-lower/%0A */%0Apublic class Problem374 %7B%0A    // test case%0A    private static int guess(int num) %7B%0A        if (num == 1702766719) %7B%0A            return 0;%0A        %7D else if (num %3C 1702766719) %7B%0A            return 1;%0A        %7D%0A        return -1;%0A    %7D%0A%0A    public int guessNumber(int n) %7B%0A        long lo = 1;%0A        long hi = n;%0A        while (lo %3C= hi) %7B%0A            long lmid = (lo + hi) / 2;%0A            int mid = (int) lmid;%0A            if (guess(mid) == 0) %7B%0A                return mid;%0A            %7D else if (guess(mid) %3C 0) %7B%0A                hi = mid - 1;%0A            %7D else %7B%0A                lo = mid + 1;%0A            %7D%0A        %7D%0A        throw new RuntimeException(%22Number not found%22);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem374 prob = new Problem374();%0A        System.out.println(prob.guessNumber(2126753390));%0A    %7D%0A%7D%0A

Solve problem 374