Binary Search Leetcode Problems Javascript Map Method