Binary Search Question Leetcode Problems Java