Book Allocation Problem Leetcode Binary Search