Binary Search Leetcode Problems Javascript Map