Binary Search Problem Leetcode Javascript Questions