@@ -0,0 +1,384 @@
+%0Apublic class _374GuessNumberHigherOrLower %7B%0A    public int guessNumber(int n) %7B%0A    %09int h = n;%0A    %09int l = 0;%0A    %09int r = h + (l - h) / 2;%0A    %09int g = guess(r);%0A        while (g != 0) %7B%0A        %09if (h - l == 1) return g == -1 ? l : h;%0A        %09else if (g == -1) h = r;%0A        %09else l = r;%0A        %09r = h + (l - h) / 2;%0A        %09g = guess(r);%0A        %7D%0A        return r;%0A    %7D%0A%7D%0A

Add 374 solution