Binary Search refactor : <p>I've received this test last night.</p>

<pre><code>` int binaryS(int[] A, int X) {
        int N = A.length;
        if (N == 0) {
            return -1;
        }
        int l = 0;
        int r = N - 1;
        while (l &lt; r) {
            int m = (l + r) / 2;
            if (A[m] &gt; X) {
                r = m - 1;
            } else {
                l = m;
            }
        }
        if (A[l] == X) {
            return l;
        }
        return -1;
    }`
</code></pre>

<p>And I have to debugg/refactor the code. <strong>Condition:</strong> "You can modify only three lines".</p>

<p>Can anyone help me?</p>
